Examples of JsDoubleFunction


Examples of org.thechiselgroup.choosel.protovis.client.jsutil.JsDoubleFunction

        /* The root panel. */
        PVPanel vis = getPVPanel().width(w).height(h).bottom(20).left(20)
                .right(10).top(5);

        /* The bars. */
        PVBar bar = vis.add(PV.Panel).data(data).top(new JsDoubleFunction() {
            public double f(JsArgs args) {
                PVMark _this = args.getThis();
                return y.fd(_this.index());
            }
        }).height(new JsDoubleFunction() {
            public double f(JsArgs args) {
                return y.rangeBand();
            }
        }).add(PV.Bar).data(new JsFunction<JsArrayNumber>() {
            public JsArrayNumber f(JsArgs args) {
                return args.getObject();
            }
        }).top(new JsDoubleFunction() {
            public double f(JsArgs args) {
                PVMark _this = args.getThis();
                return _this.index() * y.rangeBand() / m;
            }
        }).height(new JsDoubleFunction() {
            public double f(JsArgs args) {
                return y.rangeBand() / m;
            }
        }).left(0).width(new JsDoubleFunction() {
            public double f(JsArgs args) {
                double d = args.getDouble(0);
                return x.fd(d);
            }
        }).fillStyle(new JsFunction<PVColor>() {
View Full Code Here

Examples of org.thechiselgroup.choosel.protovis.client.jsutil.JsDoubleFunction

        /* The root panel. */
        PVPanel vis = getPVPanel().width(600).height(400).fillStyle("white");

        /* The ellipse plot! */
        vis.add(PV.Panel).data(data).add(PV.Ellipse)
                .left(new JsDoubleFunction() {
                    public double f(JsArgs args) {
                        return args.<int[]> getObject()[0];
                    }
                }).top(new JsDoubleFunction() {
                    public double f(JsArgs args) {
                        return args.<int[]> getObject()[1];
                    }
                }).horizontalRadius(new JsDoubleFunction() {
                    public double f(JsArgs args) {
                        return args.<int[]> getObject()[2];
                    }
                }).verticalRadius(new JsDoubleFunction() {
                    public double f(JsArgs args) {
                        return args.<int[]> getObject()[3];
                    }
                }).angle(new JsDoubleFunction() {
                    public double f(JsArgs args) {
                        return (args.<int[]> getObject()[4] * Math.PI) / 180d;
                    }
                }).fillStyle(new JsFunction<PVColor>() {
                    private PVOrdinalScale colors = PV.Colors.category10();
View Full Code Here

Examples of org.thechiselgroup.choosel.protovis.client.jsutil.JsDoubleFunction

        PVPanel vis = getPVPanel().width(796).height(796).margin(2);

        PVPackLayout pack = vis
                .add(PV.Layout.Pack())
                .nodes(PVDom.create(root, new FlareData.UnitDomAdapter())
                        .nodes()).size(new JsDoubleFunction() {
                    public double f(JsArgs args) {
                        PVDomNode d = args.getObject();
                        return d.nodeValueDouble();
                    }
                });
View Full Code Here

Examples of org.thechiselgroup.choosel.protovis.client.jsutil.JsDoubleFunction

        final PVOrdinalScale category19 = PV.Colors.category19();

        PVFillPartitionLayout partition = vis
                .add(PV.Layout.PartitionFill())
                .nodes(PVDom.create(root, new FlareData.UnitDomAdapter())
                        .nodes()).size(new JsDoubleFunction() {
                    public double f(JsArgs args) {
                        PVDomNode d = args.getObject();
                        return d.nodeValueDouble();
                    }
                }).order("descending").orient("radial");
View Full Code Here

Examples of org.thechiselgroup.choosel.protovis.client.jsutil.JsDoubleFunction

            }
        }).left(x).bottom(-5).height(5).anchor(BOTTOM).add(PV.Label)
                .text(x.tickFormat());

        /* The stack layout. */
        vis.add(PV.Layout.Stack()).layers(data).x(new JsDoubleFunction() {
            public double f(JsArgs args) {
                Point d = args.getObject(0);
                return x.fd(d.x);
            }
        }).y(new JsDoubleFunction() {
            public double f(JsArgs args) {
                Point d = args.getObject(0);
                return y.fd(d.y);
            }
        }).layer().add(PV.Area);
View Full Code Here

Examples of org.thechiselgroup.choosel.protovis.client.jsutil.JsDoubleFunction

        final PVOrdinalScale category19 = PV.Colors.category19();

        PVFillPartitionLayout partition = vis
                .add(PV.Layout.PartitionFill())
                .nodes(PVDom.create(root, new FlareData.UnitDomAdapter())
                        .nodes()).size(new JsDoubleFunction() {
                    public double f(JsArgs args) {
                        PVDomNode d = args.getObject();
                        return d.nodeValueDouble();
                    }
                }).order("descending").orient("radial");
View Full Code Here

Examples of org.thechiselgroup.choosel.protovis.client.jsutil.JsDoubleFunction

                            }

                            public double getNodeValue(ClassData t) {
                                return t.value;
                            }
                        }).nodes()).size(new JsDoubleFunction() {
                    public double f(JsArgs args) {
                        PVDomNode d = args.getObject();
                        return d.nodeValueDouble();
                    }
                }).spacing(0).order(null).node().add(PV.Dot)
View Full Code Here

Examples of org.thechiselgroup.choosel.protovis.client.jsutil.JsDoubleFunction

                        return d > 0 && d < 100;
                    }
                }).text(x.tickFormat());

        /* The dot plot! */
        vis.add(PV.Panel).data(data).add(PV.Dot).left(new JsDoubleFunction() {
            public double f(JsArgs args) {
                Triple d = args.getObject();
                return x.fd(d.x);
            }
        }).bottom(new JsDoubleFunction() {
            public double f(JsArgs args) {
                Triple d = args.getObject();
                return y.fd(d.y);
            }
        }).strokeStyle(new JsFunction<PVColor>() {
            public PVColor f(JsArgs args) {
                Triple d = args.getObject();
                return c.fcolor(d.z);
            }
        }).fillStyle(new JsFunction<PVColor>() {
            public PVColor f(JsArgs args) {
                Triple d = args.getObject();
                return c.fcolor(d.z).alpha(0.2d);
            }
        }).size(new JsDoubleFunction() {
            public double f(JsArgs args) {
                Triple d = args.getObject();
                return d.z;
            }
        }).title(new JsStringFunction() {
View Full Code Here

Examples of org.thechiselgroup.choosel.protovis.client.jsutil.JsDoubleFunction

        force = vis.add(PV.Layout.Force())
                .nodes(new NovelCharacterNodeAdapter(), nodes).links(links);

        force.link().add(PV.Line);

        force.node().add(PV.Dot).size(new JsDoubleFunction() {
            public double f(JsArgs args) {
                PVNode d = args.getObject();
                PVMark _this = args.<PVMark> getThis();
                return (d.linkDegree() + 4) * (Math.pow(_this.scale(), -1.5));
            }
View Full Code Here

Examples of org.thechiselgroup.choosel.protovis.client.jsutil.JsDoubleFunction

                    public String f(JsArgs args) {
                        PVDomNode d = args.getObject();
                        return d.nodeName();
                    }
                })
                .size(new JsDoubleFunction() {
                    public double f(JsArgs args) {
                        PVDomNode d = args.getObject();
                        return d.hasNodeValue() ? Math.max(
                                d.nodeValueInt() / 100, 10) : 10;
                    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.