vega-lite

Keep altair sliders with plots when concatenating

不打扰是莪最后的温柔 提交于 2021-02-10 22:30:34
问题 When concatenating 2 charts with their own sliders, the sliders are grouped together at the end. Is there a way to have the sliders remain with each plot? Here is an example, modified from the docs import altair.vegalite.v3 as alt import pandas as pd import numpy as np rand = np.random.RandomState(42) df = pd.DataFrame({"xval": range(100), "yval": rand.randn(100).cumsum()}) slider1 = alt.binding_range(min=0, max=100, step=1, name="cutoff1:") selector1 = alt.selection_single( name=

Keep altair sliders with plots when concatenating

家住魔仙堡 提交于 2021-02-10 22:28:08
问题 When concatenating 2 charts with their own sliders, the sliders are grouped together at the end. Is there a way to have the sliders remain with each plot? Here is an example, modified from the docs import altair.vegalite.v3 as alt import pandas as pd import numpy as np rand = np.random.RandomState(42) df = pd.DataFrame({"xval": range(100), "yval": rand.randn(100).cumsum()}) slider1 = alt.binding_range(min=0, max=100, step=1, name="cutoff1:") selector1 = alt.selection_single( name=

Keep altair sliders with plots when concatenating

被刻印的时光 ゝ 提交于 2021-02-10 22:27:48
问题 When concatenating 2 charts with their own sliders, the sliders are grouped together at the end. Is there a way to have the sliders remain with each plot? Here is an example, modified from the docs import altair.vegalite.v3 as alt import pandas as pd import numpy as np rand = np.random.RandomState(42) df = pd.DataFrame({"xval": range(100), "yval": rand.randn(100).cumsum()}) slider1 = alt.binding_range(min=0, max=100, step=1, name="cutoff1:") selector1 = alt.selection_single( name=

Keep altair sliders with plots when concatenating

吃可爱长大的小学妹 提交于 2021-02-10 22:27:32
问题 When concatenating 2 charts with their own sliders, the sliders are grouped together at the end. Is there a way to have the sliders remain with each plot? Here is an example, modified from the docs import altair.vegalite.v3 as alt import pandas as pd import numpy as np rand = np.random.RandomState(42) df = pd.DataFrame({"xval": range(100), "yval": rand.randn(100).cumsum()}) slider1 = alt.binding_range(min=0, max=100, step=1, name="cutoff1:") selector1 = alt.selection_single( name=

How to set locale to show time with my language?

╄→尐↘猪︶ㄣ 提交于 2021-02-10 17:51:59
问题 I have standard timestamps in a time series, so I need X-axis showing time in my language (suppose pt not en ) and standards of my country (suppose European or Brazilian but not US)... There are no example showing how to use it? Suppose the example bellow, how to add correct locale in it? { "data": { "values": [ {"a": "1995-10-11 09:00:00", "b": 28}, {"a": "1995-10-12 09:00:00", "b": 30}, {"a": "1995-10-13 15:00:00", "b": 34} {"a": "1995-12-17 03:00:00", "b": 29}, {"a": "1995-12-17 09:00:00",

How to set locale to show time with my language?

我与影子孤独终老i 提交于 2021-02-10 17:50:26
问题 I have standard timestamps in a time series, so I need X-axis showing time in my language (suppose pt not en ) and standards of my country (suppose European or Brazilian but not US)... There are no example showing how to use it? Suppose the example bellow, how to add correct locale in it? { "data": { "values": [ {"a": "1995-10-11 09:00:00", "b": 28}, {"a": "1995-10-12 09:00:00", "b": 30}, {"a": "1995-10-13 15:00:00", "b": 34} {"a": "1995-12-17 03:00:00", "b": 29}, {"a": "1995-12-17 09:00:00",

Using Vega Lite to display already-aggregated data

匆匆过客 提交于 2021-02-10 16:51:02
问题 I'm trying to show a stacked bar chart of sums over time. The data looks something like this: [ { "date": 12345, "sumA": 100, "sumB": 150 }, ... ] I'm encoding the x axis to the field "date". I need the bar at date 12345 to be stacked with one part being 100 high, and the other, shown in another color, being 150 high. Vega Lite seems to expect the raw data, but this would be too slow. I do this aggregate on the server side to save time. Can I spoon-feed Vega Lite the aggregates like in my

Using Vega Lite to display already-aggregated data

一曲冷凌霜 提交于 2021-02-10 16:50:18
问题 I'm trying to show a stacked bar chart of sums over time. The data looks something like this: [ { "date": 12345, "sumA": 100, "sumB": 150 }, ... ] I'm encoding the x axis to the field "date". I need the bar at date 12345 to be stacked with one part being 100 high, and the other, shown in another color, being 150 high. Vega Lite seems to expect the raw data, but this would be too slow. I do this aggregate on the server side to save time. Can I spoon-feed Vega Lite the aggregates like in my

Dynamically Change Y-Axis Field in Encoding Based on Selection Vega-Lite

天涯浪子 提交于 2021-02-10 15:42:00
问题 How can I dynamically change a data field encoded for the y-axis based upon a selection? I am trying to build a visualization to display event count data over the 24 hours of a day, and I want the user to be able to select different timezones (e.g. EST, CST, MST, or PST). To do this, I have built out a single selection where I specify all the options I list above in the parentheses, with EST being set as my default. I want to create a condition where when I chose another option besides EST, I

Add legend to line & bars to Altair chart without using size/color

自作多情 提交于 2021-02-10 14:51:44
问题 I'm using Altair to create a chart with multiple lines each of which has multiple bands (representing different CI) & I'm struggling to understand how I can add a legend. For example, in this considerably simpler example: import altair as alt import pandas as pd df = pd.DataFrame(data={'col1': [1, 2,4,5,6], 'col2': [3, 4,7,4,4], 'col3': [1.5, 2.6,4.6,5.6,6.6], 'col4': [3.6, 4.6,7.6,4.6,4.4],'col5': [1.9, 2.9,4.9,5.9,6.9], 'col4': [3.9, 4.9,7.9,4.9,4.9]}) line = alt.Chart(df).mark_line(color=