altair-viz / altair-viz.github.io Goto Github PK
View Code? Open in Web Editor NEWGenerated documentation Website for Altair; source can be found at http://github.com/altair-viz/altair/
Generated documentation Website for Altair; source can be found at http://github.com/altair-viz/altair/
In the example gallery, under area charts, the Cumulative Count Chart isn't displaying
https://altair-viz.github.io/gallery/cumulative_count_chart.html
The field name needs updated from "IMDB_Rating" to "IMDB Rating"
The Binned Heatmap is another example that uses this dataset and needs underscores replaced with spaces to work
https://altair-viz.github.io/gallery/binned_heatmap.html
Using one label for an entire facet grid is not documented in Adjusting Axis Labels.
How can I make this plot only use one y-label?
import pandas as pd
import altair as alt
data = [{"P": "HD", "T": 0, "C":100, "Max": 1},
{"P": "HD", "T": 0, "C":400, "Max": 3},
{"P": "HD", "T": 0, "C":800, "Max": 0},
{"P": "HD", "T": 23, "C":100, "Max": 2},
{"P": "HD", "T": 23, "C":400, "Max": 1},
{"P": "HD", "T": 23, "C":800, "Max": 1},
{"P": "HD", "T": 80, "C":100, "Max": 7},
{"P": "HD", "T": 80, "C":400, "Max": 2},
{"P": "HD", "T": 80, "C":800, "Max": 1},
{"P": "LD", "T": 0, "C":100, "Max": 1},
{"P": "LD", "T": 0, "C":400, "Max": 2},
{"P": "LD", "T": 0, "C":800, "Max": 7},
{"P": "LD", "T": 23, "C":100, "Max": 7},
{"P": "LD", "T": 23, "C":400, "Max": 1},
{"P": "LD", "T": 23, "C":800, "Max": 0},
{"P": "LD", "T": 80, "C":100, "Max": 2},
{"P": "LD", "T": 80, "C":400, "Max": 0},
{"P": "LD", "T": 80, "C":800, "Max": 1}]
df = pd.DataFrame(data)
chart = alt.Chart(df).mark_bar().encode(
x="P:N",
y=alt.Y("Max:Q", title="Maximum Long Word Observed (units)"),
color="P:N",
row="T:N",
column="C:N"
).properties(width=100, height=100)
P T C Max
0 HD 0 100 1
1 HD 0 400 3
2 HD 0 800 0
3 HD 23 100 2
4 HD 23 400 1
5 HD 23 800 1
6 HD 80 100 7
7 HD 80 400 2
8 HD 80 800 1
9 LD 0 100 1
10 LD 0 400 2
11 LD 0 800 7
12 LD 23 100 7
13 LD 23 400 1
14 LD 23 800 0
15 LD 80 100 2
16 LD 80 400 0
17 LD 80 800 1
I'm reading through Encodings and noticed the awesome properties()
method.
Where do I find documentation on this?
I would have expected first mention of it to be hyperlinked. It does not come up in searches on the docs page
A link to https://altair-viz.github.io/ in the org and project descriptions would be helpful.
How do I open these interactive charts? (Why don't they work in Sphinx? Is Launch in Binder the best or only way to open them?)
https://altair-viz.github.io/gallery/index.html#interactive-charts
I am curious how often the website gets updated?
I know the source of the content comes from the main repository at https://github.com/altair-viz/altair but is the release schedule automated, or do you manually publish when there is a substantial change?
Please let me know if there is a forum specifically for Altair questions and help and I will move this there.
I haven't been able to find in the documentation how facet resolves multiple entries for the facetted parameter.
In the MWE below, what does facet()
do when it encounters 3 entries where P = HD
, and T = 0
, yet only plots one value at HD, 0
in the t_facet
(T) plot.
Is this just a flawed plot?
import pandas as pd
import altair as alt
data = [{"P": "HD", "T": 0, "C":100, "Max": 1},
{"P": "HD", "T": 0, "C":400, "Max": 3},
{"P": "HD", "T": 0, "C":800, "Max": 0},
{"P": "HD", "T": 23, "C":100, "Max": 2},
{"P": "HD", "T": 23, "C":400, "Max": 1},
{"P": "HD", "T": 23, "C":800, "Max": 1},
{"P": "HD", "T": 80, "C":100, "Max": 7},
{"P": "HD", "T": 80, "C":400, "Max": 2},
{"P": "HD", "T": 80, "C":800, "Max": 1},
{"P": "LD", "T": 0, "C":100, "Max": 1},
{"P": "LD", "T": 0, "C":400, "Max": 2},
{"P": "LD", "T": 0, "C":800, "Max": 7},
{"P": "LD", "T": 23, "C":100, "Max": 7},
{"P": "LD", "T": 23, "C":400, "Max": 1},
{"P": "LD", "T": 23, "C":800, "Max": 0},
{"P": "LD", "T": 80, "C":100, "Max": 2},
{"P": "LD", "T": 80, "C":400, "Max": 0},
{"P": "LD", "T": 80, "C":800, "Max": 1}]
df = pd.DataFrame(data)
chart = alt.Chart(df).mark_bar().encode(x="P:N", y="Max:Q", color="P:N")
t_facet = chart.facet("T:N")
c_facet = chart.facet("C:N")
P T C Max
0 HD 0 100 1
1 HD 0 400 3
2 HD 0 800 0
3 HD 23 100 2
4 HD 23 400 1
5 HD 23 800 1
6 HD 80 100 7
7 HD 80 400 2
8 HD 80 800 1
9 LD 0 100 1
10 LD 0 400 2
11 LD 0 800 7
12 LD 23 100 7
13 LD 23 400 1
14 LD 23 800 0
15 LD 80 100 2
16 LD 80 400 0
17 LD 80 800 1
This is based on the issue #2411 that I originally posted in the altair
repo.
The method for making layered histograms suggested on altair-viz.github.io seems to fail to take into account null values within the range of the data: bins that should be empty are represented as having 1 observation.
Altair:
import pandas as pd
import altair as alt
import numpy as np
np.random.seed(42)
# Generating Data
source = pd.DataFrame({
'Trial A': np.random.normal(0, 0.8, 1000),
'Trial B': np.random.normal(-2, 1, 1000),
'Trial C': np.random.normal(3, 2, 1000)
})
alt.Chart(source).transform_fold(
['Trial A', 'Trial B', 'Trial C'],
as_=['Experiment', 'Measurement']
).mark_area(
opacity=0.3,
interpolate='step'
).encode(
alt.X('Measurement:Q', bin=alt.Bin(maxbins=100)),
alt.Y('count()', stack=None),
alt.Color('Experiment:N')
)
The suggested method should be mark_bar
instead of mark_area
, which correctly represents the data. I'll be doing a PR shortly.
The underlying issue with mark_area
still needs fixing however: here's how it looks in Seaborn:
Should I open the issue in https://github.com/vega/vega-lite?
I get a 404 on this page:
https://altair-viz.github.io/user_guide/projection.html
linked to from this page:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.