UNPKG

node-red-node-ui-vega

Version:
1 lines 8.52 kB
[{"id":"4df0eaa0.8903e4","type":"tab","label":"[Vega] Example Gallery","disabled":false,"info":"# Shows Examples from [Vega Example Gallery](https://vega.github.io/vega/examples/).\n\n- press button of inject node to initialize dropdown menu\n- examples are displayed on **Example 2 - Vega** tab.\n- "},{"id":"d085b235.bdf0c","type":"debug","z":"4df0eaa0.8903e4","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":950,"y":140,"wires":[]},{"id":"6cae6da3.0d4f74","type":"http request","z":"4df0eaa0.8903e4","name":"","method":"GET","ret":"obj","paytoqs":false,"url":"","tls":"","proxy":"","authType":"","x":650,"y":140,"wires":[["255bf04b.fb887"]]},{"id":"6c65efa1.30768","type":"change","z":"4df0eaa0.8903e4","name":"Vega Example URL","rules":[{"t":"set","p":"url","pt":"msg","to":"\"https://raw.githubusercontent.com/vega/vega/master/docs/examples/\" & payload","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":510,"y":200,"wires":[["6cae6da3.0d4f74"]]},{"id":"255bf04b.fb887","type":"function","z":"4df0eaa0.8903e4","name":"Fix Data URL","func":"function fixURL(obj) {\n if (obj === null) {\n return null;\n }\n else if (Array.isArray(obj)) {\n return obj.map(fixURL);\n }\n else if(typeof obj === \"object\") {\n var newObj = {};\n Object.keys(obj).forEach(function (key) {\n var val = obj[key];\n if (key === \"url\") {\n newObj[key] = \"https://raw.githubusercontent.com/vega/vega/master/docs/\" +val;\n }\n else {\n newObj[key] = fixURL(val);\n }\n });\n return newObj;\n }\n return obj;\n}\n\nmsg = {\n payload: fixURL(msg.payload)\n};\nreturn msg;","outputs":1,"noerr":0,"x":780,"y":200,"wires":[["d085b235.bdf0c","4ad60608.85a4e8"]]},{"id":"4ad60608.85a4e8","type":"ui_vega","z":"4df0eaa0.8903e4","group":"bdc8ce6f.4037b","name":"","order":2,"width":"20","height":"15","vega":"","x":930,"y":260,"wires":[]},{"id":"7185283c.a04e18","type":"inject","z":"4df0eaa0.8903e4","name":"Init","topic":"","payload":"airport-connections.vg.json","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":130,"y":80,"wires":[["d7e3a1d9.8941"]]},{"id":"d7e3a1d9.8941","type":"template","z":"4df0eaa0.8903e4","name":"List of Examples","field":"options","fieldType":"msg","format":"json","syntax":"plain","template":"[\n {\n \"Bar Chart\": \"bar-chart.vg.json\"\n },\n {\n \"Stacked Bar Chart\": \"stacked-bar-chart.vg.json\"\n },\n {\n \"Grouped Bar Chart\": \"grouped-bar-chart.vg.json\"\n },\n {\n \"Nested Bar Chart\": \"nested-bar-chart.vg.json\"\n },\n {\n \"Population Pyramid\": \"population-pyramid.vg.json\"\n },\n {\n \"Line Chart\": \"line-chart.vg.json\"\n },\n {\n \"Area Chart\": \"area-chart.vg.json\"\n },\n {\n \"Stacked Area Chart\": \"stacked-area-chart.vg.json\"\n },\n {\n \"Horizon Graph\": \"horizon-graph.vg.json\"\n },\n {\n \"Job Voyager\": \"job-voyager.vg.json\"\n },\n {\n \"Pie Chart\": \"pie-chart.vg.json\"\n },\n {\n \"Donut Chart\": \"donut-chart.vg.json\"\n },\n {\n \"Radial Plot\": \"radial-plot.vg.json\"\n },\n {\n \"Scatter Plot\": \"scatter-plot.vg.json\"\n },\n {\n \"Scatter Plot Null Values\": \"scatter-plot-null-values.vg.json\"\n },\n {\n \"Connected Scatter Plot\": \"connected-scatter-plot.vg.json\"\n },\n {\n \"Error Bars\": \"error-bars.vg.json\"\n },\n {\n \"Barley Trellis Plot\": \"barley-trellis-plot.vg.json\"\n },\n {\n \"Histogram\": \"histogram.vg.json\"\n },\n {\n \"Histogram Null Values\": \"histogram-null-values.vg.json\"\n },\n {\n \"Probability Density\": \"probability-density.vg.json\"\n },\n {\n \"Box Plot\": \"box-plot.vg.json\"\n },\n {\n \"Violin Plot\": \"violin-plot.vg.json\"\n },\n {\n \"Top K Plot\": \"top-k-plot.vg.json\"\n },\n {\n \"Top K Plot With Others\": \"top-k-plot-with-others.vg.json\"\n },\n {\n \"Binned Scatter Plot\": \"binned-scatter-plot.vg.json\"\n },\n {\n \"Contour Plot\": \"contour-plot.vg.json\"\n },\n {\n \"Wheat Plot\": \"wheat-plot.vg.json\"\n },\n {\n \"Hypothetical Outcome Plots\": \"hypothetical-outcome-plots.vg.json\"\n },\n {\n \"Regression\": \"regression.vg.json\"\n },\n {\n \"Loess Regression\": \"loess-regression.vg.json\"\n },\n {\n \"County Unemployment\": \"county-unemployment.vg.json\"\n },\n {\n \"Dorling Cartogram\": \"dorling-cartogram.vg.json\"\n },\n {\n \"World Map\": \"world-map.vg.json\"\n },\n {\n \"Earthquakes\": \"earthquakes.vg.json\"\n },\n {\n \"Zoomable World Map\": \"zoomable-world-map.vg.json\"\n },\n {\n \"Distortion Comparison\": \"distortion-comparison.vg.json\"\n },\n {\n \"Volcano Contours\": \"volcano-contours.vg.json\"\n },\n {\n \"Wind Vectors\": \"wind-vectors.vg.json\"\n },\n {\n \"Tree Layout\": \"tree-layout.vg.json\"\n },\n {\n \"Radial Tree Layout\": \"radial-tree-layout.vg.json\"\n },\n {\n \"Treemap\": \"treemap.vg.json\"\n },\n {\n \"Circle Packing\": \"circle-packing.vg.json\"\n },\n {\n \"Sunburst\": \"sunburst.vg.json\"\n },\n {\n \"Edge Bundling\": \"edge-bundling.vg.json\"\n },\n {\n \"Force Directed Layout\": \"force-directed-layout.vg.json\"\n },\n {\n \"Reorderable Matrix\": \"reorderable-matrix.vg.json\"\n },\n {\n \"Arc Diagram\": \"arc-diagram.vg.json\"\n },\n {\n \"Airport Connections\": \"airport-connections.vg.json\"\n },\n {\n \"heatmap\": \"heatmap.vg.json\"\n },\n {\n \"Parallel Coordinates\": \"parallel-coordinates.vg.json\"\n },\n {\n \"Word Cloud\": \"word-cloud.vg.json\"\n },\n {\n \"Timelines\": \"timelines.vg.json\"\n },\n {\n \"Beeswarm Plot\": \"beeswarm-plot.vg.json\"\n },\n {\n \"Budget Forecasts\": \"budget-forecasts.vg.json\"\n },\n {\n \"Wheat And Wages\": \"wheat-and-wages.vg.json\"\n },\n {\n \"Falkensee Population\": \"falkensee-population.vg.json\"\n },\n {\n \"Annual Temperature\": \"annual-temperature.vg.json\"\n },\n {\n \"Weekly Temperature\": \"weekly-temperature.vg.json\"\n },\n {\n \"U District Cuisine\": \"u-district-cuisine.vg.json\"\n },\n {\n \"Crossfilter Flights\": \"crossfilter-flights.vg.json\"\n },\n {\n \"Overview Plus Detail\": \"overview-plus-detail.vg.json\"\n },\n {\n \"Brushing Scatter Plots\": \"brushing-scatter-plots.vg.json\"\n },\n {\n \"Zoomable Scatter Plot\": \"zoomable-scatter-plot.vg.json\"\n },\n {\n \"Global Development\": \"global-development.vg.json\"\n },\n {\n \"Interactive Legend\": \"interactive-legend.vg.json\"\n },\n {\n \"Stock Index Chart\": \"stock-index-chart.vg.json\"\n },\n {\n \"Pi Monte Carlo\": \"pi-monte-carlo.vg.json\"\n }\n]\n","output":"json","x":230,"y":140,"wires":[["1802e500.0b75db"]]},{"id":"320491a9.81638e","type":"comment","z":"4df0eaa0.8903e4","name":"Press to initialize dropdown","info":"","x":180,"y":40,"wires":[]},{"id":"78ed878b.a0d208","type":"comment","z":"4df0eaa0.8903e4","name":"To see Vega definition","info":"","x":980,"y":100,"wires":[]},{"id":"5b63fa23.ba2ed4","type":"comment","z":"4df0eaa0.8903e4","name":"Visualize by Vega","info":"","x":960,"y":300,"wires":[]},{"id":"1802e500.0b75db","type":"ui_dropdown","z":"4df0eaa0.8903e4","name":"","label":"","tooltip":"","place":"Select option","group":"bdc8ce6f.4037b","order":1,"width":0,"height":0,"passthru":true,"options":[{"label":"","value":"","type":"str"}],"payload":"","topic":"","x":310,"y":200,"wires":[["6c65efa1.30768"]]},{"id":"bdc8ce6f.4037b","type":"ui_group","z":"","name":"Group 1","tab":"2dc5ccfe.b52214","order":1,"disp":false,"width":"20","collapse":false},{"id":"2dc5ccfe.b52214","type":"ui_tab","z":"","name":"[Vega] Example Gallery","icon":"dashboard","order":7,"disabled":false,"hidden":false}]