Creates a viewport that lays out content horizontally
322253
public static <T, C extends Cell<T, ?>> VirtualFlow<T, C> createHorizontal(
            ObservableList<T> items,
            Function<? super T, ? extends C> cellFactory,
            Gravity gravity) {
        return new VirtualFlow<>(items, cellFactory, new HorizontalHelper(), gravity);
    }
1274491
def _render_content(self, content, **settings):
        
        if not self.SETTING_WIDTH in settings or not settings[self.SETTING_WIDTH]:
            settings[self.SETTING_WIDTH] = TERMINAL_WIDTH

        s = {k: settings[k] for k in (self.SETTING_WIDTH, self.SETTING_FLAG_BORDER, self.SETTING_MARGIN, self.SETTING_MARGIN_LEFT, self.SETTING_MARGIN_RIGHT, self.SETTING_PADDING, self.SETTING_PADDING_LEFT, self.SETTING_PADDING_RIGHT)}
        width_int = self.calculate_width_content(**s)

        lines = self._wrap_content(content, width_int)

        result = []
        if settings[self.SETTING_FLAG_BORDER]:
            result.append(self._render_border_line('t', settings))
        if settings[self.SETTING_FLAG_HEADER]:
            s = {k: settings[k] for k in settings.keys()}
            s[self.SETTING_TEXT_FORMATING] = s[self.SETTING_HEADER_FORMATING]
            result.append(self._render_line(settings[self.SETTING_HEADER_CONTENT], s))
            result.append(self._render_border_line('m', settings))
        for l in lines:
            result.append(self._render_line(l, settings))
        if settings[self.SETTING_FLAG_BORDER]:
            result.append(self._render_border_line('b', settings))
        return result
75361
function() {
		var dimensions = this._layoutManager.config.dimensions,
			width = dimensions.dragProxyWidth,
			height = dimensions.dragProxyHeight;

		this.element.width( width );
		this.element.height( height );
		width -= ( this._sided ? dimensions.headerHeight : 0 );
		height -= ( !this._sided ? dimensions.headerHeight : 0 );
		this.childElementContainer.width( width );
		this.childElementContainer.height( height );
		this._contentItem.element.width( width );
		this._contentItem.element.height( height );
		this._contentItem.callDownwards( '_$show' );
		this._contentItem.callDownwards( 'setSize' );
	}
702596
private Box makeViewPort(Length x, Length y, Length width, Length height)
   {
      float  _x = (x != null) ? x.floatValueX(this) : 0f;
      float  _y = (y != null) ? y.floatValueY(this) : 0f;

      Box viewPortUser = getCurrentViewPortInUserUnits();
      float  _w = (width != null) ? width.floatValueX(this) : viewPortUser.width;  // default 100%
      float  _h = (height != null) ? height.floatValueY(this) : viewPortUser.height;

      return new Box(_x, _y, _w, _h);
   }
668690
function View(props) {
	props = props || {};
	this.addCanvasContainerToDOMBody = this.addCanvasContainerToDOMBody.bind(this);
	this.addCanvasToContainer = this.addCanvasToContainer.bind(this);

	this.adaptiveResolution = props.adaptiveResolution;
	this.adaptiveResolutionManager = new AdaptiveResolutionManager(props.adaptiveResolutionSettings);

	this.fitAxis = props.fitAxis || 'y';

	this.skipRender = Boolean(props.skipRender);
	this.scene = props.scene || new THREE.Scene();
	props.rendererSettings = props.rendererSettings || {};
	if(props.camera) {
		this.camera = props.camera;
	} else {
		this.camera = new THREE.PerspectiveCamera();
		this.scene.add(this.camera);
		this.camera.position.z = 8.50;
		this.camera.position.y = 8.0;
		this.camera.lookAt(this.scene.position);
	}
	if(this.camera instanceof THREE.PerspectiveCamera) {
		this.setCamera = this.setCameraPerspective;
	} else if (this.camera.isOrthographicCamera) {
		this.setCamera = this.setCameraOthrographic;
	}
	this.autoStartRender = props.autoStartRender !== (undefined ? props.autoStartRender : true);
	this.canvasContainerID = props.canvasContainerID || "WebGLCanvasContainer";

	this.domMode = props.domMode || (props.canvasContainer ? DOMMode.CONTAINER : DOMMode.FULLSCREEN);
	this.canvasContainer = props.canvasContainer || this.createCanvasContainer(this.canvasContainerID);
	this.canvasID = props.canvasID || "WebGLCanvas";
	this.domMode = props.domMode || (this.canvasContainer ? DOMMode.CONTAINER : DOMMode.FULLSCREEN);
	this.domSize = {x:0, y:0};
	
	//use provided canvas or make your own
	this.canvas = document.getElementById(this.canvasID) || this.createCanvas();
	this.rendererSettings = defaults(props.rendererSettings, {
		canvas: this.canvas,
		antialias: true,
		preserveDrawingBuffer: false
	});


	if( props.renderer !== undefined) {
		this.renderer = props.renderer;
	} else {
		this.renderer = new THREE.WebGLRenderer(this.rendererSettings);
	}
	if(this.rendererSettings.autoClear === false) {
		this.renderer.autoClear = false;
		this.renderer.autoClearColor = false;
	}

	this.renderManager = new RenderManager(this, props.useRafPolyfill);
	if(this.autoStartRender) this.renderManager.start();

	this.adaptiveResolutionManager.onChange.add(this.onAdaptiveResolutionManagerChangeResolution.bind(this));

	this.renderer.setPixelRatio(window.devicePixelRatio);
	this.dpr = this.renderer.getPixelRatio();

	this.setupResizing();

	if(props.stats) {
		this.stats = new RenderStats(this.renderer);
		this.renderManager.onEnterFrame.add(this.stats.onEnterFrame);
		this.renderManager.onExitFrame.add(this.stats.onExitFrame);
	}

}
753620
def make_vertical_box(cls, children, layout=Layout(), duplicates=False):
        ""
        if not duplicates: return widgets.VBox(children, layout=layout)
        else: return widgets.VBox([children[0], children[2]], layout=layout)
675516
function (renderer) {
            var viewport = me.game.viewport,
                width = this.imagewidth,
                height = this.imageheight,
                bw = viewport.bounds.width,
                bh = viewport.bounds.height,
                ax = this.anchorPoint.x,
                ay = this.anchorPoint.y,
                x = this.pos.x,
                y = this.pos.y;

            if (this.ratio.x === this.ratio.y === 0) {
                x = x + ax * (bw - width);
                y = y + ay * (bh - height);
            }

            renderer.translate(x, y);
            renderer.drawPattern(
                this._pattern,
                0,
                0,
                viewport.width * 2,
                viewport.height * 2
            );
        }
192235
function(){
		var portHeight=parseFloat($("#workarea").css("height"));
		var portWidth=parseFloat($("#workarea").css("width"));
		var portX=$("#workarea").scrollLeft();
		var portY=$("#workarea").scrollTop();
		var windowWidth=parseFloat($("#svgcanvas").css("width"));
		var windowHeight=parseFloat($("#svgcanvas").css("height"));
		var overviewWidth=$("#overviewMiniView").attr("width");
		var overviewHeight=$("#overviewMiniView").attr("height");
		
		var viewBoxX=portX/windowWidth*overviewWidth;
		var viewBoxY=portY/windowHeight*overviewHeight;
		var viewBoxWidth=portWidth/windowWidth*overviewWidth;
		var viewBoxHeight=portHeight/windowHeight*overviewHeight;
		
		$("#overview_window_view_box").css("min-width",viewBoxWidth+"px");
		$("#overview_window_view_box").css("min-height",viewBoxHeight+"px");
		$("#overview_window_view_box").css("top",viewBoxY+"px");
		$("#overview_window_view_box").css("left",viewBoxX+"px");
	}
440892
def _layout(self):
        """"""

        self.EnableGridLines(False)

        # Standard row and col sizes for zooming
        default_cell_attributes = \
            self.code_array.cell_attributes.default_cell_attributes

        self.std_row_size = default_cell_attributes["row-height"]
        self.std_col_size = default_cell_attributes["column-width"]

        self.SetDefaultRowSize(self.std_row_size)
        self.SetDefaultColSize(self.std_col_size)

        # Standard row and col label sizes for zooming
        self.col_label_size = self.GetColLabelSize()
        self.row_label_size = self.GetRowLabelSize()

        self.SetRowMinimalAcceptableHeight(1)
        self.SetColMinimalAcceptableWidth(1)

        self.SetCellHighlightPenWidth(0)
113697
function View(configuration = {}) {
    let { visibility, axis, direction, target, offset } = configuration


    // Error Handling
    if (!target) {
        console.error('[in-view] -> target property must be an element')
        return
    }

    if (target.offsetParent === null)
        return false


    // Default values
    visibility = visibility || 'visible'
    axis = axis || 'y'
    direction = direction || 'linear'
    offset = offset || {}

    offset.top = offset.top || 0
    offset.bottom = offset.bottom || 0
    offset.right = offset.right || 0
    offset.left = offset.left || 0

    // New config with default values
    configuration = {
        visibility, axis, direction, offset, target
    }


    // Error Handling
    if (!/^(visible|entire)$/.test(visibility)) {
        console.error(`[in-view] -> visibility take only value: 'visible' or 'entire'`)
        return
    }

    if (!/^(x|y|both)$/.test(axis)) {
        console.error(`[in-view] -> axis take only value: 'x', 'y' or 'both'`)
        return
    }

    if (!/^(linear|end|start)$/.test(direction)) {
        console.error(`[in-view] -> direction take only value: 'linear', 'end' or 'start'`)
        return
    }

    if (offset.toString() !== '[object Object]') {
        console.error(`[in-view] -> offset must be a plain object and can include properties: top, left, bottom, right with number values`)
        return
    }



    // rect data of target and screen
    const { top, bottom, left, right, width, height } = target.getBoundingClientRect()
    const { clientHeight, clientWidth } = document.documentElement
    const { innerHeight, innerWidth } = window



    // return booleans for visible and entire state of visibility
    const results = {
        visible: {
            top: top + height - offset.top >= 0,
            left: left + width - offset.left >= 0,
            bottom: bottom - height - offset.bottom <= (innerHeight || clientHeight),
            right: right - width - offset.right <= (innerWidth || clientWidth)
        },

        entire: {
            top: top - offset.top >= 0,
            left: left - offset.left >= 0,
            bottom: bottom - offset.bottom <= (innerHeight || clientHeight),
            right: right - offset.right <= (innerWidth || clientWidth)
        }
    }

    // Return boolean
    return getResult(configuration, results)

}
707224
function visibleLines(display,doc,viewport){var top=viewport&&viewport.top!=null?Math.max(0,viewport.top):display.scroller.scrollTop;top=Math.floor(top-paddingTop(display));var bottom=viewport&&viewport.bottom!=null?viewport.bottom:top+display.wrapper.clientHeight;var from=_lineAtHeight(doc,top),to=_lineAtHeight(doc,bottom);// Ensure is a {from: {line, ch}, to: {line, ch}} object, and
// forces those lines into the viewport (if possible).
if(viewport&&viewport.ensure){var ensureFrom=viewport.ensure.from.line,ensureTo=viewport.ensure.to.line;if(ensureFrom<from){from=ensureFrom;to=_lineAtHeight(doc,_heightAtLine(getLine(doc,ensureFrom))+display.wrapper.clientHeight);}else if(Math.min(ensureTo,doc.lastLine())>=to){from=_lineAtHeight(doc,_heightAtLine(getLine(doc,ensureTo))-display.wrapper.clientHeight);to=ensureTo;}}return{from:from,to:Math.max(to,from+1)};}
795132
function layoutSingleSeries(seriesModel, offset, boxWidth) {
    var coordSys = seriesModel.coordinateSystem;
    var data = seriesModel.getData();
    var halfWidth = boxWidth / 2;
    var cDimIdx = seriesModel.get('layout') === 'horizontal' ? 0 : 1;
    var vDimIdx = 1 - cDimIdx;
    var coordDims = ['x', 'y'];
    var cDim = data.mapDimension(coordDims[cDimIdx]);
    var vDims = data.mapDimension(coordDims[vDimIdx], true);

    if (cDim == null || vDims.length < 5) {
        return;
    }

    for (var dataIndex = 0; dataIndex < data.count(); dataIndex++) {
        var axisDimVal = data.get(cDim, dataIndex);

        var median = getPoint(axisDimVal, vDims[2], dataIndex);
        var end1 = getPoint(axisDimVal, vDims[0], dataIndex);
        var end2 = getPoint(axisDimVal, vDims[1], dataIndex);
        var end4 = getPoint(axisDimVal, vDims[3], dataIndex);
        var end5 = getPoint(axisDimVal, vDims[4], dataIndex);

        var ends = [];
        addBodyEnd(ends, end2, 0);
        addBodyEnd(ends, end4, 1);

        ends.push(end1, end2, end5, end4);
        layEndLine(ends, end1);
        layEndLine(ends, end5);
        layEndLine(ends, median);

        data.setItemLayout(dataIndex, {
            initBaseline: median[vDimIdx],
            ends: ends
        });
    }

    function getPoint(axisDimVal, dimIdx, dataIndex) {
        var val = data.get(dimIdx, dataIndex);
        var p = [];
        p[cDimIdx] = axisDimVal;
        p[vDimIdx] = val;
        var point;
        if (isNaN(axisDimVal) || isNaN(val)) {
            point = [NaN, NaN];
        }
        else {
            point = coordSys.dataToPoint(p);
            point[cDimIdx] += offset;
        }
        return point;
    }

    function addBodyEnd(ends, point, start) {
        var point1 = point.slice();
        var point2 = point.slice();
        point1[cDimIdx] += halfWidth;
        point2[cDimIdx] -= halfWidth;
        start
            ? ends.push(point1, point2)
            : ends.push(point2, point1);
    }

    function layEndLine(ends, endCenter) {
        var from = endCenter.slice();
        var to = endCenter.slice();
        from[cDimIdx] -= halfWidth;
        to[cDimIdx] += halfWidth;
        ends.push(from, to);
    }
}
1003304
def build_gui(self, container):
        
        vbox = Widgets.VBox()
        vbox.set_border_width(2)
        vbox.set_spacing(1)

        w = Viewers.GingaViewerWidget(viewer=self)
        vbox.add_widget(w, stretch=1)

        # set up to capture cursor movement for reading out coordinates

        # coordinates reported in base 1 or 0?
        self.pixel_base = 1.0

        self.readout = Widgets.Label("")
        vbox.add_widget(self.readout, stretch=0)

        #self.set_callback('none-move', self.motion_cb)
        self.set_callback('cursor-changed', self.motion_cb)

        # need to put this in an hbox with an expanding label or the
        # browser wants to resize the canvas, distorting it
        hbox = Widgets.HBox()
        hbox.add_widget(vbox, stretch=0)
        hbox.add_widget(Widgets.Label(''), stretch=1)

        container.set_widget(hbox)
1310900
def _create_layout(self):
        
        waits_for_confirmation = WaitsForConfirmation(self.pymux)

        return FloatContainer(
            content=HSplit([
                # The main window.
                FloatContainer(
                    Background(),
                    floats=[
                        Float(width=lambda: self.pymux.get_window_size().columns,
                              height=lambda: self.pymux.get_window_size().rows,
                              content=DynamicBody(self.pymux))
                    ]),
                # Status bar.
                ConditionalContainer(
                    content=VSplit([
                        # Left.
                        Window(
                            height=1,
                            width=(lambda: D(max=self.pymux.status_left_length)),
                            dont_extend_width=True,
                            content=FormattedTextControl(self._get_status_left_tokens)),
                        # List of windows in the middle.
                        Window(
                            height=1,
                            char=' ',
                            align=self._get_align,
                            content=FormattedTextControl(self._get_status_tokens)),
                        # Right.
                        Window(
                            height=1,
                            width=(lambda: D(max=self.pymux.status_right_length)),
                            dont_extend_width=True,
                            align=WindowAlign.RIGHT,
                            content=FormattedTextControl(self._get_status_right_tokens))
                    ], z_index=Z_INDEX.STATUS_BAR, style='class:statusbar'),
                    filter=Condition(lambda: self.pymux.enable_status),
                )
            ]),
            floats=[
                Float(bottom=1, left=0, z_index=Z_INDEX.MESSAGE_TOOLBAR,
                      content=MessageToolbar(self.client_state)),
                Float(left=0, right=0, bottom=0, content=HSplit([
                    # Wait for confirmation toolbar.
                    ConditionalContainer(
                        content=Window(
                            height=1,
                            content=ConfirmationToolbar(self.pymux, self.client_state),
                            z_index=Z_INDEX.COMMAND_LINE,
                        ),
                        filter=waits_for_confirmation,
                    ),
                    # ':' prompt toolbar.
                    ConditionalContainer(
                        content=Window(
                            height=D(min=1),  # Can be more if the command is multiline.
                            style='class:commandline',
                            dont_extend_height=True,
                            content=BufferControl(
                                buffer=self.client_state.command_buffer,
                                preview_search=True,
                                input_processors=[
                                    AppendAutoSuggestion(),
                                    BeforeInput(':', style='class:commandline-prompt'),
                                    ShowArg(),
                                    HighlightSelectionProcessor(),
                                ]),
                            z_index=Z_INDEX.COMMAND_LINE,
                        ),
                        filter=has_focus(self.client_state.command_buffer),
                    ),
                    # Other command-prompt commands toolbar.
                    ConditionalContainer(
                        content=Window(
                            height=1,
                            style='class:commandline',
                            content=BufferControl(
                                buffer=self.client_state.prompt_buffer,
                                input_processors=[
                                    BeforeInput(self._before_prompt_command_tokens),
                                    AppendAutoSuggestion(),
                                    HighlightSelectionProcessor(),
                                ]),
                            z_index=Z_INDEX.COMMAND_LINE,
                        ),
                        filter=has_focus(self.client_state.prompt_buffer),
                    ),
                ])),
                # Keys pop-up.
                Float(
                    content=ConditionalContainer(
                        content=self.popup_dialog,
                        filter=Condition(lambda: self.client_state.display_popup),
                    ),
                    left=3, right=3, top=5, bottom=5,
                    z_index=Z_INDEX.POPUP,
                ),
                Float(xcursor=True, ycursor=True, content=CompletionsMenu(max_height=12)),
            ]
        )
245430
def draw(self, surface):
        """"""
        offset = 0
        i = 0
        ol, ot = self.screen_topleft_offset
        first = self.options and self.options[0]
        last = self.options and self.options[-1]
        for o in self.options:
            indent = o.get('padding_col', 0)

            # padding above the line
            if o != first and o.get('padding_line', 0):
                offset += o['padding_line']

            font = o.get('font', self._font)
            if i == self.option and self.focus_color:
                clr = self.focus_color
            else:
                clr = self.color
            text = o['label']
            ren = font.render(text, 1, clr)
            if ren.get_width() > self.width:
                self.width = ren.get_width()
            o['label_rect'] = pygame.Rect(
                (ol + self.x + indent, ot + self.y + offset),
                (ren.get_width(), ren.get_height()),
            )
            surface.blit(ren, (self.x + indent, self.y + offset))
            offset += font.get_height()

            # padding below the line
            if o != last and o.get('padding_line', 0):
                offset += o['padding_line']

            i += 1
1320591
def onMargins(self, left=0.1, top=0.1, right=0.1, bottom=0.1):
        
        bconf = self.panel_bot.conf
        l, t, r, b = bconf.margins
        bconf.set_margins(left=left, top=t, right=right, bottom=b)
        bconf.canvas.draw()
1186280
function (x, y, w, h) {
            this.gl.viewport(x, y, w, h);
        }