Powered by AppSignal & Oban Pro
Would you like to see your link here? Contact us

Lab: Tucan

elixir/tucan.livemd

Lab: Tucan

Mix.install([
  {:tucan, "~> 0.4.1"},
  {:kino, "~> 0.14.2"},
  {:kino_vega_lite, "~> 0.1.13"},
  {:nx, "~> 0.9.1"}
])

Introduction

Tucan is a high-level API interface for creating plots on top of VegaLite. It is designed to simplify the creation of interactive and visually stunning plots. You can effortlessly generate a wide range of plots from simple bar charts to complex composite plots all while enjoying the power and flexibility of clean, composable, functional APIs.

Plots: https://hexdocs.pm/tucan/Tucan.html#plots

Composite Plots: https://hexdocs.pm/tucan/Tucan.html#composite-plots

Auxillary Plots: https://hexdocs.pm/tucan/Tucan.html#auxiliary-plots

Basic Usage

Scatter Plots

Tucan.scatter(:iris, "petal_width", "petal_length", height: 800, width: 800)
{"$schema":"https://vega.github.io/schema/vega-lite/v5.json","data":{"url":"https://gist.githubusercontent.com/curran/a08a1080b88344b0c8a7/raw/0e7a9b0a5d22642a06d3d5b9bcbad9890c8ee534/iris.csv"},"encoding":{"x":{"field":"petal_width","scale":{"zero":false},"type":"quantitative"},"y":{"field":"petal_length","scale":{"zero":false},"type":"quantitative"}},"height":800,"mark":{"fillOpacity":1,"type":"point"},"width":800}

Semantic grouping can be applied via additional options such as the color, shape or size of the data points.

Tucan.scatter(
  :iris,
  "petal_width",
  "petal_length",
  color_by: "species",
  shape_by: "species",
  height: 700,
  width: 700
)
{"$schema":"https://vega.github.io/schema/vega-lite/v5.json","data":{"url":"https://gist.githubusercontent.com/curran/a08a1080b88344b0c8a7/raw/0e7a9b0a5d22642a06d3d5b9bcbad9890c8ee534/iris.csv"},"encoding":{"color":{"field":"species","type":"nominal"},"shape":{"field":"species","type":"nominal"},"x":{"field":"petal_width","scale":{"zero":false},"type":"quantitative"},"y":{"field":"petal_length","scale":{"zero":false},"type":"quantitative"}},"height":700,"mark":{"fillOpacity":1,"type":"point"},"width":700}

These function option modifiers are really just function calls that can also be used explicitly

Tucan.scatter(:iris, "petal_width", "petal_length", height: 700, width: 700)
|> Tucan.color_by("species")
|> Tucan.shape_by("species")
{"$schema":"https://vega.github.io/schema/vega-lite/v5.json","data":{"url":"https://gist.githubusercontent.com/curran/a08a1080b88344b0c8a7/raw/0e7a9b0a5d22642a06d3d5b9bcbad9890c8ee534/iris.csv"},"encoding":{"color":{"field":"species"},"shape":{"field":"species"},"x":{"field":"petal_width","scale":{"zero":false},"type":"quantitative"},"y":{"field":"petal_length","scale":{"zero":false},"type":"quantitative"}},"height":700,"mark":{"fillOpacity":1,"type":"point"},"width":700}

Nx Support

If the :nx dependency is installed you can pass a tensor directly as the data columns

x = Nx.linspace(-20, 20, n: 200)
y = Nx.pow(x, 2)
Tucan.lineplot([x: x, y: y], "x", "y", height: 800, width: 800)
{"$schema":"https://vega.github.io/schema/vega-lite/v5.json","data":{"values":[{"x":-20.0,"y":400.0},{"x":-19.798994064331055,"y":392.0001525878906},{"x":-19.597990036010742,"y":384.0812072753906},{"x":-19.396984100341797,"y":376.24298095703125},{"x":-19.195980072021484,"y":368.48565673828125},{"x":-18.99497413635254,"y":360.8090515136719},{"x":-18.793970108032227,"y":353.21331787109375},{"x":-18.59296417236328,"y":345.69830322265625},{"x":-18.39196014404297,"y":338.2641906738281},{"x":-18.190954208374023,"y":330.91082763671875},{"x":-17.98995018005371,"y":323.6383056640625},{"x":-17.788944244384766,"y":316.446533203125},{"x":-17.587940216064453,"y":309.33563232421875},{"x":-17.386934280395508,"y":302.30548095703125},{"x":-17.185930252075195,"y":295.356201171875},{"x":-16.98492431640625,"y":288.4876403808594},{"x":-16.783920288085938,"y":281.6999816894531},{"x":-16.582914352416992,"y":274.9930419921875},{"x":-16.38191032409668,"y":268.3669738769531},{"x":-16.180904388427734,"y":261.8216552734375},{"x":-15.979899406433105,"y":255.357177734375},{"x":-15.778894424438477,"y":248.9735107421875},{"x":-15.577889442443848,"y":242.67063903808594},{"x":-15.376884460449219,"y":236.44857788085938},{"x":-15.17587947845459,"y":230.30731201171875},{"x":-14.974874496459961,"y":224.2468719482422},{"x":-14.773869514465332,"y":218.26722717285156},{"x":-14.572864532470703,"y":212.36837768554688},{"x":-14.371858596801758,"y":206.55032348632812},{"x":-14.170854568481445,"y":200.81312561035156},{"x":-13.9698486328125,"y":195.15667724609375},{"x":-13.768844604492188,"y":189.58108520507812},{"x":-13.567838668823242,"y":184.08624267578125},{"x":-13.36683464050293,"y":178.67227172851562},{"x":-13.165828704833984,"y":173.33905029296875},{"x":-12.964824676513672,"y":168.08668518066406},{"x":-12.763818740844727,"y":162.91506958007812},{"x":-12.562814712524414,"y":157.82431030273438},{"x":-12.361808776855469,"y":152.81431579589844},{"x":-12.16080379486084,"y":147.88514709472656},{"x":-11.959798812866211,"y":143.0367889404297},{"x":-11.758793830871582,"y":138.26922607421875},{"x":-11.557788848876953,"y":133.58248901367188},{"x":-11.356783866882324,"y":128.97654724121094},{"x":-11.155778884887695,"y":124.45140075683594},{"x":-10.954773902893066,"y":120.00707244873047},{"x":-10.753768920898438,"y":115.64354705810547},{"x":-10.552763938903809,"y":111.36082458496094},{"x":-10.35175895690918,"y":107.1589126586914},{"x":-10.15075397491455,"y":103.03780364990234},{"x":-9.949748992919922,"y":98.99750518798828},{"x":-9.748744010925293,"y":95.03800964355469},{"x":-9.547739028930664,"y":91.15931701660156},{"x":-9.346734046936035,"y":87.36143493652344},{"x":-9.14572811126709,"y":83.64434051513672},{"x":-8.944723129272461,"y":80.00807189941406},{"x":-8.743718147277832,"y":76.45260620117188},{"x":-8.542713165283203,"y":72.97795104980469},{"x":-8.341708183288574,"y":69.58409881591797},{"x":-8.140703201293945,"y":66.27104949951172},{"x":-7.939698219299316,"y":63.0388069152832},{"x":-7.7386932373046875,"y":59.88737487792969},{"x":-7.537688255310059,"y":56.81674575805664},{"x":-7.33668327331543,"y":53.82691955566406},{"x":-7.135678291320801,"y":50.917903900146484},{"x":-6.934673309326172,"y":48.08969497680664},{"x":-6.733668327331543,"y":45.342288970947266},{"x":-6.532663345336914,"y":42.675689697265625},{"x":-6.331658363342285,"y":40.08989715576172},{"x":-6.130653381347656,"y":37.58491134643555},{"x":-5.929648399353027,"y":35.160728454589844},{"x":-5.728643417358398,"y":32.81735610961914},{"x":-5.5276384353637695,"y":30.554786682128906},{"x":-5.326633453369141,"y":28.373023986816406},{"x":-5.125628471374512,"y":26.27206802368164},{"x":-4.924622535705566,"y":24.251907348632812},{"x":-4.7236175537109375,"y":22.312562942504883},{"x":-4.522612571716309,"y":20.454025268554688},{"x":-4.32160758972168,"y":18.676292419433594},{"x":-4.120602607727051,"y":16.979366302490234},{"x":-3.919597625732422,"y":15.363245964050293},{"x":-3.7185935974121094,"y":13.827938079833984},{"x":-3.517587661743164,"y":12.373422622680664},{"x":-3.3165836334228516,"y":10.999727249145508},{"x":-3.1155776977539062,"y":9.70682430267334},{"x":-2.9145736694335938,"y":8.494739532470703},{"x":-2.7135677337646484,"y":7.363450050354004},{"x":-2.512561798095703,"y":6.312966823577881},{"x":-2.3115577697753906,"y":5.343299388885498},{"x":-2.1105518341064453,"y":4.4544291496276855},{"x":-1.9095478057861328,"y":3.6463727951049805},{"x":-1.7085418701171875,"y":2.9191153049468994},{"x":-1.507537841796875,"y":2.272670269012451},{"x":-1.3065319061279297,"y":1.7070256471633911},{"x":-1.1055278778076172,"y":1.2221919298171997},{"x":-0.9045219421386719,"y":0.8181599378585815},{"x":-0.7035179138183594,"y":0.4949374496936798},{"x":-0.5025119781494141,"y":0.25251829624176025},{"x":-0.30150794982910156,"y":0.09090704470872879},{"x":-0.10050201416015625,"y":0.010100655257701874},{"x":0.10050201416015625,"y":0.010100655257701874},{"x":0.30150794982910156,"y":0.09090704470872879},{"x":0.5025119781494141,"y":0.25251829624176025},{"x":0.7035179138183594,"y":0.4949374496936798},{"x":0.9045219421386719,"y":0.8181599378585815},{"x":1.1055278778076172,"y":1.2221919298171997},{"x":1.3065319061279297,"y":1.7070256471633911},{"x":1.507537841796875,"y":2.272670269012451},{"x":1.7085437774658203,"y":2.919121742248535},{"x":1.9095478057861328,"y":3.6463727951049805},{"x":2.110553741455078,"y":4.454437255859375},{"x":2.3115577697753906,"y":5.343299388885498},{"x":2.512563705444336,"y":6.312976360321045},{"x":2.7135677337646484,"y":7.363450050354004},{"x":2.9145736694335938,"y":8.494739532470703},{"x":3.1155776977539062,"y":9.70682430267334},{"x":3.3165836334228516,"y":10.999727249145508},{"x":3.517587661743164,"y":12.373422622680664},{"x":3.7185935974121094,"y":13.827938079833984},{"x":3.919597625732422,"y":15.363245964050293},{"x":4.120603561401367,"y":16.979373931884766},{"x":4.32160758972168,"y":18.676292419433594},{"x":4.522613525390625,"y":20.45403289794922},{"x":4.7236175537109375,"y":22.312562942504883},{"x":4.924623489379883,"y":24.251916885375977},{"x":5.125627517700195,"y":26.272056579589844},{"x":5.326633453369141,"y":28.373023986816406},{"x":5.527637481689453,"y":30.55477523803711},{"x":5.728643417358398,"y":32.81735610961914},{"x":5.929649353027344,"y":35.16073989868164},{"x":6.130653381347656,"y":37.58491134643555},{"x":6.331659317016602,"y":40.089908599853516},{"x":6.532663345336914,"y":42.675689697265625},{"x":6.733669281005859,"y":45.34230041503906},{"x":6.934673309326172,"y":48.08969497680664},{"x":7.135679244995117,"y":50.91791915893555},{"x":7.33668327331543,"y":53.82691955566406},{"x":7.537689208984375,"y":56.81675720214844},{"x":7.7386932373046875,"y":59.88737487792969},{"x":7.939699172973633,"y":63.038822174072266},{"x":8.140703201293945,"y":66.27104949951172},{"x":8.34170913696289,"y":69.58411407470703},{"x":8.542713165283203,"y":72.97795104980469},{"x":8.743719100952148,"y":76.45262145996094},{"x":8.944723129272461,"y":80.00807189941406},{"x":9.145729064941406,"y":83.64436340332031},{"x":9.346733093261719,"y":87.36141967773438},{"x":9.547739028930664,"y":91.15931701660156},{"x":9.748743057250977,"y":95.03799438476562},{"x":9.949748992919922,"y":98.99750518798828},{"x":10.150754928588867,"y":103.03782653808594},{"x":10.35175895690918,"y":107.1589126586914},{"x":10.552764892578125,"y":111.36084747314453},{"x":10.753768920898438,"y":115.64354705810547},{"x":10.954774856567383,"y":120.00709533691406},{"x":11.155778884887695,"y":124.45140075683594},{"x":11.35678482055664,"y":128.9765625},{"x":11.557788848876953,"y":133.58248901367188},{"x":11.758794784545898,"y":138.26925659179688},{"x":11.959798812866211,"y":143.0367889404297},{"x":12.160804748535156,"y":147.8851776123047},{"x":12.361808776855469,"y":152.81431579589844},{"x":12.562812805175781,"y":157.8242645263672},{"x":12.76382064819336,"y":162.9151153564453},{"x":12.964824676513672,"y":168.08668518066406},{"x":13.165828704833984,"y":173.33905029296875},{"x":13.366832733154297,"y":178.67221069335938},{"x":13.567840576171875,"y":184.0863037109375},{"x":13.768844604492188,"y":189.58108520507812},{"x":13.9698486328125,"y":195.15667724609375},{"x":14.170852661132812,"y":200.8130645751953},{"x":14.37186050415039,"y":206.5503692626953},{"x":14.572864532470703,"y":212.36837768554688},{"x":14.773868560791016,"y":218.26719665527344},{"x":14.974876403808594,"y":224.24691772460938},{"x":15.175880432128906,"y":230.30734252929688},{"x":15.376884460449219,"y":236.44857788085938},{"x":15.577888488769531,"y":242.6706085205078},{"x":15.77889633178711,"y":248.97357177734375},{"x":15.979900360107422,"y":255.35720825195312},{"x":16.180904388427734,"y":261.8216552734375},{"x":16.381908416748047,"y":268.3669128417969},{"x":16.582916259765625,"y":274.99310302734375},{"x":16.783920288085938,"y":281.6999816894531},{"x":16.98492431640625,"y":288.4876403808594},{"x":17.185928344726562,"y":295.35614013671875},{"x":17.38693618774414,"y":302.3055419921875},{"x":17.587940216064453,"y":309.33563232421875},{"x":17.788944244384766,"y":316.446533203125},{"x":17.989948272705078,"y":323.63824462890625},{"x":18.190956115722656,"y":330.910888671875},{"x":18.39196014404297,"y":338.2641906738281},{"x":18.59296417236328,"y":345.69830322265625},{"x":18.79397201538086,"y":353.21337890625},{"x":18.994976043701172,"y":360.8091125488281},{"x":19.195980072021484,"y":368.48565673828125},{"x":19.396984100341797,"y":376.24298095703125},{"x":19.597991943359375,"y":384.081298828125},{"x":19.798995971679688,"y":392.000244140625},{"x":20.0,"y":400.0}]},"encoding":{"x":{"field":"x","type":"quantitative"},"y":{"field":"y","type":"quantitative"}},"height":800,"mark":{"fillOpacity":1,"type":"line"},"width":800}

Composite Plots

Composite plots are a visualization technique that combine multiple plots or graphical elements into a single unified display, allowing for simultaneous presentation of related data in different ways, enabling comparison and comprehensive analysis

fields = ["Beak Length (mm)", "Beak Depth (mm)", "Body Mass (g)"]
Tucan.pairplot(:penguins, fields, diagonal: :density)
{"$schema":"https://vega.github.io/schema/vega-lite/v5.json","columns":3,"concat":[{"encoding":{"x":{"axis":{"title":null},"field":"value","scale":{"zero":false},"type":"quantitative"},"y":{"axis":{"title":"Beak Length (mm)"},"field":"density","stack":null,"type":"quantitative"}},"mark":{"fillOpacity":1,"orient":"vertical","type":"area"},"transform":[{"counts":false,"cumulative":false,"density":"Beak Length (mm)","maxsteps":200,"minsteps":25}]},{"encoding":{"x":{"axis":{"title":null},"field":"Beak Depth (mm)","scale":{"zero":false},"type":"quantitative"},"y":{"axis":{"title":null},"field":"Beak Length (mm)","scale":{"zero":false},"type":"quantitative"}},"mark":{"fillOpacity":1,"type":"point"}},{"encoding":{"x":{"axis":{"title":null},"field":"Body Mass (g)","scale":{"zero":false},"type":"quantitative"},"y":{"axis":{"title":null},"field":"Beak Length (mm)","scale":{"zero":false},"type":"quantitative"}},"mark":{"fillOpacity":1,"type":"point"}},{"encoding":{"x":{"axis":{"title":null},"field":"Beak Length (mm)","scale":{"zero":false},"type":"quantitative"},"y":{"axis":{"title":"Beak Depth (mm)"},"field":"Beak Depth (mm)","scale":{"zero":false},"type":"quantitative"}},"mark":{"fillOpacity":1,"type":"point"}},{"encoding":{"x":{"axis":{"title":null},"field":"value","scale":{"zero":false},"type":"quantitative"},"y":{"axis":{"title":null},"field":"density","stack":null,"type":"quantitative"}},"mark":{"fillOpacity":1,"orient":"vertical","type":"area"},"transform":[{"counts":false,"cumulative":false,"density":"Beak Depth (mm)","maxsteps":200,"minsteps":25}]},{"encoding":{"x":{"axis":{"title":null},"field":"Body Mass (g)","scale":{"zero":false},"type":"quantitative"},"y":{"axis":{"title":null},"field":"Beak Depth (mm)","scale":{"zero":false},"type":"quantitative"}},"mark":{"fillOpacity":1,"type":"point"}},{"encoding":{"x":{"axis":{"title":"Beak Length (mm)"},"field":"Beak Length (mm)","scale":{"zero":false},"type":"quantitative"},"y":{"axis":{"title":"Body Mass (g)"},"field":"Body Mass (g)","scale":{"zero":false},"type":"quantitative"}},"mark":{"fillOpacity":1,"type":"point"}},{"encoding":{"x":{"axis":{"title":"Beak Depth (mm)"},"field":"Beak Depth (mm)","scale":{"zero":false},"type":"quantitative"},"y":{"axis":{"title":null},"field":"Body Mass (g)","scale":{"zero":false},"type":"quantitative"}},"mark":{"fillOpacity":1,"type":"point"}},{"encoding":{"x":{"axis":{"title":"Body Mass (g)"},"field":"value","scale":{"zero":false},"type":"quantitative"},"y":{"axis":{"title":null},"field":"density","stack":null,"type":"quantitative"}},"mark":{"fillOpacity":1,"orient":"vertical","type":"area"},"transform":[{"counts":false,"cumulative":false,"density":"Body Mass (g)","maxsteps":200,"minsteps":25}]}],"data":{"url":"https://raw.githubusercontent.com/vega/vega-datasets/next/data/penguins.json"}}

Customization & Themes

Modifying the styles of a plot is easy to do with the various methods and helper modules that Tucan provides

Tucan.bubble(:gapminder, "income", "health", "population", width: 600, tooltip: :data)
|> Tucan.color_by("region")
|> Tucan.Axes.set_x_title("GDP per Capita")
|> Tucan.Axes.set_y_title("Life Expectancy")
|> Tucan.Scale.set_x_scale(:log)
|> Tucan.Grid.set_color(:x, "red")
{"$schema":"https://vega.github.io/schema/vega-lite/v5.json","data":{"url":"https://vega.github.io/vega-datasets/data/gapminder-health-income.csv"},"encoding":{"color":{"field":"region"},"size":{"field":"population","type":"quantitative"},"x":{"axis":{"gridColor":"red","title":"GDP per Capita"},"field":"income","scale":{"type":"log","zero":false},"type":"quantitative"},"y":{"axis":{"title":"Life Expectancy"},"field":"health","scale":{"zero":false},"type":"quantitative"}},"mark":{"tooltip":{"content":"data"},"type":"circle"},"width":600}
Tucan.density_heatmap(:penguins, "Beak Length (mm)", "Beak Depth (mm)")
|> Tucan.set_theme(:latimes)
{"$schema":"https://vega.github.io/schema/vega-lite/v5.json","config":{"arc":{"fill":"#82c6df"},"area":{"fill":"#82c6df"},"axis":{"labelFont":"Benton Gothic, sans-serif","labelFontSize":11.5,"labelFontWeight":"normal","titleFont":"Benton Gothic Bold, sans-serif","titleFontSize":13,"titleFontWeight":"normal"},"axisX":{"labelangle":0,"labelpadding":4,"ticksize":3},"axisY":{"labelbaseline":"middle","maxextent":45,"minextent":45,"ticksize":2,"titlealign":"left","titleangle":0,"titlex":-45,"titley":-11},"background":"#ffffff","legend":{"font":"Benton Gothic, sans-serif","fontSize":11.5,"symboltype":"square","titleFont":"Benton Gothic Bold, sans-serif","titleFontSize":13,"titleFontWeight":"normal"},"line":{"stroke":"#82c6df","strokeWidth":2},"path":{"stroke":"#82c6df"},"range":{"category":["#ec8431","#829eb1","#c89d29","#3580b1","#adc839","#ab7fb4"],"diverging":["#e68a4f","#f4bb6a","#f9e39c","#dadfe2","#a6b7c6","#849eae"],"heatmap":["#fbf2c7","#f9e39c","#f8d36e","#f4bb6a","#e68a4f","#d15a40","#ab4232"],"ordinal":["#fbf2c7","#f9e39c","#f8d36e","#f4bb6a","#e68a4f","#d15a40","#ab4232"],"ramp":["#fbf2c7","#f9e39c","#f8d36e","#f4bb6a","#e68a4f","#d15a40","#ab4232"]},"rect":{"fill":"#82c6df"},"shape":{"stroke":"#82c6df"},"symbol":{"fill":"#82c6df","size":30},"title":{"anchor":"start","color":"#000000","font":"Benton Gothic Bold, sans-serif","fontSize":22,"fontWeight":"normal"}},"data":{"url":"https://raw.githubusercontent.com/vega/vega-datasets/next/data/penguins.json"},"encoding":{"color":{"aggregate":"count","type":"quantitative"},"x":{"bin":true,"field":"Beak Length (mm)","type":"quantitative"},"y":{"bin":true,"field":"Beak Depth (mm)","type":"quantitative"}},"mark":{"fillOpacity":1,"type":"rect"}}

Encoding Channel Options

An optional configuration option can be added for every encoding channel that is used to create a plot, this allows you to add any vega-lite option or change the default options set by Tucan

Tucan.bar(
  :weather,
  "date",
  "date",
  height: 400,
  width: 700,
  color_by: "weather",
  tooltip: true,
  x: [type: :ordinal, time_unit: :month],
  y: [aggregate: :count]
)
{"$schema":"https://vega.github.io/schema/vega-lite/v5.json","data":{"url":"https://vega.github.io/editor/data/weather.csv"},"encoding":{"color":{"field":"weather"},"x":{"axis":{"labelAngle":0},"field":"date","timeUnit":"month","type":"ordinal"},"y":{"aggregate":"count","field":"date","type":"quantitative"}},"height":400,"mark":{"fillOpacity":1,"tooltip":true,"type":"bar"},"width":700}

Interactive Plots

Most Tucan plots support zooming and panning. To activate them, set the :zoomable option to true

Tucan.scatter(:iris, "petal_width", "petal_length", zoomable: true)
{"$schema":"https://vega.github.io/schema/vega-lite/v5.json","data":{"url":"https://gist.githubusercontent.com/curran/a08a1080b88344b0c8a7/raw/0e7a9b0a5d22642a06d3d5b9bcbad9890c8ee534/iris.csv"},"encoding":{"x":{"field":"petal_width","scale":{"zero":false},"type":"quantitative"},"y":{"field":"petal_length","scale":{"zero":false},"type":"quantitative"}},"mark":{"fillOpacity":1,"type":"point"},"params":[{"bind":"scales","name":"_grid","select":"interval"}]}

Tooltips can be added to a plot by setting the :tooltip option to truen

Tucan.histogram(:cars, "Horsepower", tooltip: true, zoomable: true)
{"$schema":"https://vega.github.io/schema/vega-lite/v5.json","__tucan__":{"plot":"histogram"},"data":{"url":"https://vega.github.io/editor/data/cars.json"},"encoding":{"x":{"bin":{"binned":true},"field":"bin_Horsepower","title":"Horsepower"},"x2":{"field":"bin_Horsepower_end"},"y":{"field":"count_Horsepower","stack":null,"type":"quantitative"}},"mark":{"fillOpacity":1,"tooltip":true,"type":"bar"},"params":[{"bind":"scales","name":"_grid","select":"interval"}],"transform":[{"as":"bin_Horsepower","bin":true,"field":"Horsepower"},{"aggregate":[{"as":"count_Horsepower","op":"count"}],"groupby":["bin_Horsepower","bin_Horsepower_end"]}]}