Package org.thechiselgroup.choosel.protovis.client

Examples of org.thechiselgroup.choosel.protovis.client.PVPanel


    /* bullet graph specs */

    private void createVisualization(JsArrayGeneric<Bullet> bullets) {

        PVPanel vis = graphWidget.getPVPanel().data(bullets).width(400).height(30)
                .margin(20).left(120).top(new JsDoubleFunction() {
                    public double f(JsArgs args) {
                        PVMark _this = args.getThis();
                        return 10 + _this.index() * 60;
                    }
                });

        PVBulletLayout bullet = vis.add(PV.Layout.Bullet()).orient(LEFT)
                .ranges(new JsFunction<JsArrayNumber>() {
                    public JsArrayNumber f(JsArgs args) {
                        Bullet d = args.getObject();
                        return JsUtils.toJsArrayNumber(d.ranges);
                    }
View Full Code Here


    /* bullet graph specs */

    private PVPanel createVisualization() {

        PVPanel vis = graphWidget.getPVPanel().width(400).height(30)
                .margin(20).left(120).top(new JsDoubleFunction() {
                    public double f(JsArgs args) {
                        PVMark _this = args.getThis();
                        return 10 + _this.index() * 60;
                    }
                });


        PVBulletLayout bullet = vis.add(PV.Layout.Bullet()).orient(LEFT)
                .ranges(new JsFunction<JsArrayNumber>() {
                    public JsArrayNumber f(JsArgs args) {
                        Bullet d = args.getObject();
                        return JsUtils.toJsArrayNumber(d.ranges);
                    }
View Full Code Here

    /* bullet graph specs */

    private void createVisualization(JsArrayGeneric<Bullet> bullets) {

        PVPanel vis = graphWidget.getPVPanel().data(bullets).width(400).height(30)
                .margin(20).left(120).top(new JsDoubleFunction() {
                    public double f(JsArgs args) {
                        PVMark _this = args.getThis();
                        return 10 + _this.index() * 60;
                    }
                });

        PVBulletLayout bullet = vis.add(PV.Layout.Bullet()).orient(LEFT)
                .ranges(new JsFunction<JsArrayNumber>() {
                    public JsArrayNumber f(JsArgs args) {
                        Bullet d = args.getObject();
                        return JsUtils.toJsArrayNumber(d.ranges);
                    }
View Full Code Here

        int legendLabelWidth = estimator.getWidth(shapeLegendLabel);
        int shapePanelWidth = legendLabelWidth > descriptionsWidth ? legendLabelWidth
                : descriptionsWidth;

        // panel for legend
        PVPanel shapePanel = getChart()
                .add(PV.Panel)
                .bottom(-AXIS_LEGEND_SPACE - SHAPE_LEGEND_HEIGHT
                        - SHAPE_LEGEND_OFFSET).left(0)
                .fillStyle(SHAPE_LEGEND_BACKGROUND_COLOR)
                .height(SHAPE_LEGEND_HEIGHT).width(shapePanelWidth);

        // shape legend title
        shapePanel.add(PV.Label).bottom(SHAPE_LEGEND_PANEL_PADDING)
                .left(shapePanelWidth / 2).font(FONT).text(shapeLegendLabel)
                .textAlign(PVAlignment.CENTER);

        shapePanel
                .add(PV.Dot)
                .data(shapeLegend.entrySet())
                .top(2 + (SHAPE_SIZE / 2))
                .shape(new JsStringFunction() {
                    @Override
View Full Code Here

        int legendLabelWidth = estimator.getWidth(shapeLegendLabel);
        int shapePanelWidth = legendLabelWidth > descriptionsWidth ? legendLabelWidth
                : descriptionsWidth;

        // panel for legend
        PVPanel shapePanel = getChart()
                .add(PV.Panel)
                .bottom(-AXIS_LEGEND_SPACE - SHAPE_LEGEND_HEIGHT
                        - SHAPE_LEGEND_OFFSET).left(0)
                .fillStyle(SHAPE_LEGEND_BACKGROUND_COLOR)
                .height(SHAPE_LEGEND_HEIGHT).width(shapePanelWidth);

        // shape legend title
        shapePanel.add(PV.Label).bottom(SHAPE_LEGEND_PANEL_PADDING)
                .left(shapePanelWidth / 2).font(FONT).text(shapeLegendLabel)
                .textAlign(PVAlignment.CENTER);

        shapePanel
                .add(PV.Dot)
                .data(shapeLegend.entrySet())
                .top(2 + (SHAPE_SIZE / 2))
                .shape(new JsStringFunction() {
                    @Override
View Full Code Here

        /* A scale that maps 0 - 1000 to 50 - 1050 */
        PVLinearScale tickPositionScale = PV.Scale.linear(0, totalBarWidth)
                .range(LEFT_LABEL_PADDING, totalBarWidth + LEFT_LABEL_PADDING);

        /* Root panel */
        PVPanel vis = chartWidget
                .getPVPanel()
                .width(totalBarWidth + LEFT_LABEL_PADDING + CHART_RIGHT_PADDING)
                .height(chartHeight + CHART_BOTTOM_PADDING);

        /* Add one panel for each horizontal bar */
        PVPanel panel = vis.add(PV.Panel).data(dataPairs).top(panelTopFunction)
                .height(panelHeightFunction);

        /* an invisible panel that will handle mouse events */
        invisibleInteractionBar = vis.add(PV.Panel).data(visualItemsJsArray)
                .left(LEFT_LABEL_PADDING).width(totalBarWidthFunction)
                .top(panelTopFunction).height(panelHeightFunction)
                .cursor(POINTER).events(ALL)
                .strokeStyle(barBorderColorFunction).lineWidth(3);

        /* Add a label to each panel */
        panel.anchor(PVAlignment.LEFT).add(PV.Label).text(panelLabelFunction);

        PVPanel innerPanel = panel.add(PV.Panel).left(LEFT_LABEL_PADDING)
                .fillStyle("#ffffff");

        /* Add many vertical bars (slices) to each horizontal Panel (bar) */
        innerPanel.add(PV.Bar).data(childDataFunction).top(0)
                .left(sliceLeftFunction).width(sliceWidthFunction)
                .fillStyle(colorFunction);

        /* Add X axis ticks with number labels */
        vis.add(PV.Rule).data(tickPositionScale.ticks(calculateNumTicks()))
View Full Code Here

    /* bullet graph specs */

    private PVPanel createVisualization() {

        PVPanel vis = graphWidget.getPVPanel().width(400).height(30)
                .margin(20).left(120).top(new JsDoubleFunction() {
                    public double f(JsArgs args) {
                        PVMark _this = args.getThis();
                        return 10 + _this.index() * 60;
                    }
                });


        PVBulletLayout bullet = vis.add(PV.Layout.Bullet()).orient(LEFT)
                .ranges(new JsFunction<JsArrayNumber>() {
                    public JsArrayNumber f(JsArgs args) {
                        Bullet d = args.getObject();
                        return JsUtils.toJsArrayNumber(d.ranges);
                    }
View Full Code Here

    /* bullet graph specs */

    private PVPanel createVisualization(final ProtovisWidget graphWidget) {

        final PVPanel vis = graphWidget.getPVPanel()
                .width(400)
                .height(30)
                .margin(20)
                .left(100// translate(_,y)
                .top(
                        new JsDoubleFunction() {
                            public double f(JsArgs args) {
                                PVMark _this = args.getThis();
                                return 10 + _this.index() * 60; // translate(x,_)
                            }
                        }
                );

        PVBulletLayout bullet = vis.add(PV.Layout.Bullet()).orient(LEFT)
                .ranges(new JsFunction<JsArrayNumber>() {
                    public JsArrayNumber f(JsArgs args) {
                        Bullet d = args.getObject();
                        return JsUtils.toJsArrayNumber(d.ranges);
                    }
View Full Code Here

TOP

Related Classes of org.thechiselgroup.choosel.protovis.client.PVPanel

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.