vega-lite

Is it possible to display vega/vega-lite bar based on period time column?

雨燕双飞 提交于 2021-01-29 05:53:17
问题 I was wonder if it is possible to create a vega/vega-lite visualization , based on time periodic columns. For example , assume that i would like to display a graph of athletics results in a bar/other visualization. rio-2016-athletics I have tried to make some changes to simple bar chart bellow. I have edited only the "amount" column in order to display time-period results: "data": [ { "name": "table", "values": [ {"category": "1", "amount": 1:42.15}, {"category": "2", "amount": 1:42.61}, {

Is it possible to display vega/vega-lite bar based on period time column?

谁说我不能喝 提交于 2021-01-29 05:52:54
问题 I was wonder if it is possible to create a vega/vega-lite visualization , based on time periodic columns. For example , assume that i would like to display a graph of athletics results in a bar/other visualization. rio-2016-athletics I have tried to make some changes to simple bar chart bellow. I have edited only the "amount" column in order to display time-period results: "data": [ { "name": "table", "values": [ {"category": "1", "amount": 1:42.15}, {"category": "2", "amount": 1:42.61}, {

Can you have facets & layers in single Vegalite plot?

本小妞迷上赌 提交于 2021-01-28 07:32:35
问题 I am struggling to understand why a layer spec like the below: "layer": [ {"encoding": { "facet": {"field": "FEATURE_VALUE"}, "x": { "field": "DATE", "type": "temporal" }, "y": { "field": "VALUE", "type": "quantitative" } }, "mark": { "type": "line" }} ] Throws an error to the effect of: Cannot read property 'push' of undefined Meanwhile, the unit spec: "encoding": { "facet": {"field": "FEATURE_VALUE"}, "x": { "field": "DATE", "type": "temporal" }, "y": { "field": "VALUE", "type":

Can you have facets & layers in single Vegalite plot?

跟風遠走 提交于 2021-01-28 07:18:29
问题 I am struggling to understand why a layer spec like the below: "layer": [ {"encoding": { "facet": {"field": "FEATURE_VALUE"}, "x": { "field": "DATE", "type": "temporal" }, "y": { "field": "VALUE", "type": "quantitative" } }, "mark": { "type": "line" }} ] Throws an error to the effect of: Cannot read property 'push' of undefined Meanwhile, the unit spec: "encoding": { "facet": {"field": "FEATURE_VALUE"}, "x": { "field": "DATE", "type": "temporal" }, "y": { "field": "VALUE", "type":

How to render Altair / Vega in a PyQt widget

不羁的心 提交于 2021-01-27 22:07:18
问题 Is it possible to have Altair or Vega(-Lite) render to a PyQt widget, similar to Matplotlib supporting multiple backends? I know I can use a Qt WebView widget to render a web page with Vega-embed, but I want to prevent the overhead of having to serve this, even if locally. 回答1: The best option to visualize a plot with Altair is to use QWebEngineView since altair what is to create javascript code based on the instructions you set. IMHO the best solution is to obtain the html of the chart and

Altair Ridgeline doesn't create a plot with nominal groups

徘徊边缘 提交于 2021-01-27 17:30:44
问题 I try to create a Ridgeline plot in altair. Let's assume my dataframe consists of str and float columns: a object b float64 dtype: object with values like a b 0 25 2303.0 1 29 2676.0 2 18 2983.0 3 16 1489.0 4 21 3468.0 I used code from Altair gallery to create my chart: https://altair-viz.github.io/gallery/ridgeline_plot.html. My code with changed data and column names: import pandas as np import numpy as np source = pd.DataFrame(columns=list('ab')) source['a'] = np.random.randint(0,17,size

How to use all circle sizes in a punchcard?

删除回忆录丶 提交于 2021-01-24 11:43:15
问题 This VEGA-lite demo of Table Bubble Plot uses all sizes, from small to big circles. My script, illustrated below, is not using, there are only 2 or 3 sizes. How to enforce or say to VEGA-lite use all circle sizes? { "$schema": "https://vega.github.io/schema/vega-lite/v4.json", "data": { "url":"/_sql/myTable"}, "mark": "circle", "encoding": { "y": { "field": "instant", "type": "ordinal", "timeUnit": "day", "sort": ["mon", "tue", "wed", "thu", "fri", "sat", "sun"] }, "x": { "field": "instant",

How to use all circle sizes in a punchcard?

為{幸葍}努か 提交于 2021-01-24 11:43:11
问题 This VEGA-lite demo of Table Bubble Plot uses all sizes, from small to big circles. My script, illustrated below, is not using, there are only 2 or 3 sizes. How to enforce or say to VEGA-lite use all circle sizes? { "$schema": "https://vega.github.io/schema/vega-lite/v4.json", "data": { "url":"/_sql/myTable"}, "mark": "circle", "encoding": { "y": { "field": "instant", "type": "ordinal", "timeUnit": "day", "sort": ["mon", "tue", "wed", "thu", "fri", "sat", "sun"] }, "x": { "field": "instant",

How to use all circle sizes in a punchcard?

我与影子孤独终老i 提交于 2021-01-24 11:40:07
问题 This VEGA-lite demo of Table Bubble Plot uses all sizes, from small to big circles. My script, illustrated below, is not using, there are only 2 or 3 sizes. How to enforce or say to VEGA-lite use all circle sizes? { "$schema": "https://vega.github.io/schema/vega-lite/v4.json", "data": { "url":"/_sql/myTable"}, "mark": "circle", "encoding": { "y": { "field": "instant", "type": "ordinal", "timeUnit": "day", "sort": ["mon", "tue", "wed", "thu", "fri", "sat", "sun"] }, "x": { "field": "instant",

What's the proper way to implement a custom click handler in vega-lite

邮差的信 提交于 2021-01-24 07:37:26
问题 I don't seem to be able to figure this out by reading the docs. Is there a way to implement a onClick event handler for any of my marks? 回答1: Since Vega-Lite does not yet have support for signals, you could patch the generated Vega. You can add a signal to the compiled Vega spec and then add a signal listener through the Vega view API. You can patch the generated Vega with the patch option in Vega-Embed. <!DOCTYPE html> <head> <meta charset="utf-8"> <script src="https://cdn.jsdelivr.net/npm