Questions tagged [vega-lite]
Vega-Lite is a high-level grammar of interactive graphics. It provides a concise JSON syntax for rapidly generating visualizations to support analysis. Vega-Lite specifications can be compiled to Vega specifications.
891
questions
0
votes
1
answer
15
views
Python Altair, `mark_line()`, _ignore_ NaN instead of _skipping_ them or treating them as 0?
As far as I can see, for example here, the only two ways Altair handles NaNs is either "filter" or None. In the context of mark_line(), "filter" means that the NaN will be skipped, ...
0
votes
0
answers
23
views
How to edit a color scheme?
I am using Altair for Python and my current heatmap code uses a redyellowblue color scheme (A) that uses yellow as the middle color. I am trying to edit this color scheme in order to achieve the ...
0
votes
1
answer
31
views
vega lite chart axis labels issue
I have used this given example chart (circle_custom_tick_labels) https://vega.github.io/editor/#/examples/vega-lite/circle_custom_tick_labels for vega lite
{
"data": {
"values": [{&...
0
votes
1
answer
22
views
Using Altair's interval selection as a filter in a multi-view chart
In my concatenated chart, I’m using an interval selection as a filter (see the GIF, Python code, and VL spec below).
Even though my selection appears to be empty, my filtered chart still shows some ...
0
votes
0
answers
19
views
Use variable in binding on Vega Lite
I'm trying to create a custom Kibana visualization here, using Vega Lite. I have my datapull:
data: {
url: {
%context%: true
%timefield%: dateStamp
index: index_1
body: {
size: ...
1
vote
1
answer
21
views
How to filter text mark with small values that are overlapping in stack bar chart on vega lite
Some of the text overlap with one another because the value is very small, so there isn't enough space for the text mark. I have tried using transform with filter, but the position of the text mark ...
0
votes
1
answer
29
views
Bug? Using a data transform with date/timeunit
For a while now I've been using a flatten transform to move data from a columnar data frame to a Vega Lite spec, and wonder if it's the source of a recent problem I've encountered with a time series. ...
0
votes
0
answers
10
views
incrementing x-axis in vega lite
I am trying to graph the change in median temperature overtime, but cannot figure out how to stagger my x axis so it does not look as cluttered. As of now, all dates are showing on the x axis and I ...
0
votes
0
answers
18
views
Vega show field in tooltip
Here's my data: https://snipboard.io/LpqQnG.jpg
And here's my schema:
{
"$schema": "https://vega.github.io/schema/vega-lite/v4.json",
"description": "A plot for ...
0
votes
1
answer
26
views
how to make marker for tooltip bigger
Here's my wandb vega. The problem is, right now, it is very hard to mouse over my line and get the tooltip to show. It is like you must hover over the exact pixel of the line with your mouse. How do I ...
0
votes
1
answer
20
views
Vega-Lite: More Complex Sort Functions
https://vega.github.io/vega-lite/docs/sort.html
Is there a way to pass in a more complex sort to a vega lite chart? For example could I pass something like a javascript function in to work as a ...
0
votes
0
answers
20
views
Opensearch and Vega retrieve null fields in composite aggregation
I'm using the VEGA visualization in OpenSearch to create a tree representation like this example from the documentation. Data are stored inside an index and I'm currently storing 3 fields related to ...
0
votes
1
answer
65
views
Deneb Vega Lite Map not displaying
I am using the deneb visualisation in PowerBI and I am trying to create a map of Australia, there aren't any errors coming up with the below json code but my map is not displaying. Does anyone know ...
0
votes
2
answers
42
views
Semi Circle Donut Chart with Altair
I'm new to Altair. Could you help me to figure out how to plot something like this in Python?
0
votes
0
answers
26
views
Vega lite api miss-behaving
I prepared this vegalite visualization:
data = [{"student_name": "student 0", "e": "100.15", "d": "127.81"}, {"student_name": "student 1", "e": "100.30", "d": "189.94"}, {"student_name": "student ...
1
vote
1
answer
32
views
how to layer multiple regression lines without repeating code?
I'm using Vega Lite to chart the times at which I eat my meals, and want a regression (loess) line showing the general time for each. By default, a regression uses the entire dataset and only shows ...
1
vote
1
answer
35
views
Is there a way to reverse the color scheme of an altair choropleth map with binned data?
So I am trying to create a choropleth map at the county level using binned data in Altair. I got the bin function to work, but I can't reverse the direction of the color scheme. If I use the following ...
0
votes
0
answers
20
views
Is it possible to implement data classification scheme (for choropleth plot) in altair?
I am creating a choropleth plot function with Altair and want to use different data classification scheme for the size of the scatter markers. I have looked up the bin parameters and bin transform in ...
2
votes
1
answer
26
views
Vega Line Chart add tooltip
Could anyone help to add a tooltip to my Line Chart example?
I tried to add something like but no luck
tooltip: [
{ field: 'x', type: 'quantitative' },
{ field: 'y', type: 'quantitative' },
...
3
votes
1
answer
35
views
Altair Javascript error preventing chart display with specific column encoding
Working with a Formula 1 dataset -- the Pandas DataFrame has a column "constructorID" which has the constructors in an all-lowercase, underscore format (like "red_bull") while the &...
0
votes
0
answers
16
views
Vega-Lite: Add a layer to a multi view plot based on an if-condition
I'm trying to build a simple text only dashboard with Kibana based on responses like the one below
{
"_index": "jenkins-plasma4-2022.04.08-000001",
"_type": &...
0
votes
1
answer
39
views
Is it possible to left-align the row label in a Row Facet?
Is it possible to left-align the row label in a Row Facet?
In this case the row field of "Sub-Category".
For example, ...
Accessories
Appliances
Art
.............................................
0
votes
1
answer
24
views
How to show selection / calculated data in vega-lite tooltip?
I'm trying to calculate price difference of a selection in a chart provided in Vega Editor.
The goal is to display a price difference in tooltip calculated as end value of selection - start value of ...
0
votes
1
answer
54
views
How can we proramatically generate vega grammar JSON from vega-lite plot?
I am able to get vega json grammar on local installation of nodejs with vega-lite and vega-lite-api installed through npm as follows:
vl = require('vega-lite')
vla = require('vega-lite-api')
data = ...
0
votes
1
answer
35
views
Vega statistics Get Transform result as an object
I want to use transform in Vega and get results as an object. Similar to the example in the link:
https://vega.github.io/vega/docs/transforms/aggregate/
I want to get the output, example: [{"v&...
2
votes
1
answer
41
views
Understanding the interaction between mark_line point overlay and legend
I have found some unintuitive behavior in the interaction between the point property of mark_line and the appearance of the color legend for Altair/Vega-Lite. I ran into this when attempting to ...
0
votes
0
answers
9
views
Vegalite on the left is a binned bar chart, want corresponding bar to be selected on the left and the chart on right to show the bar within range
On the left is a binned bar chart, I want the corresponding bar to be selected on the left and the chart on the right to show the chart within that range
{
"$schema": "https://...
0
votes
0
answers
28
views
Aggregating on two filter terms or more
How can I aggregate on two filter terms (strings) or more based on values stored in the same value column?, at the moment I'm trying to make a dashboard warning lamp based on two alarm events e.g.
&...
0
votes
1
answer
65
views
Vega-lite: skip invalid values instead of treating as 0 for aggregate sum
When doing an aggregate sum on a column and charting it using Vega-Lite, is it possible to skip invalid values instead of treating them as 0 when doing the addition? When there is missing/invalid data,...
0
votes
1
answer
27
views
vega-lite show all x-axis values
I have a vega-lite bar chart with years as the x-axis (counts as the y). The user selects a range of years to show. When the data is sparse, some years have a 0 count and are not showing on the ...
1
vote
1
answer
30
views
How to filter data using a slider in vega-lite?
I am using the following code to plot a bubble plot using vega-lite. I want to transform values as I change the year value using the slider. But it's not working.
{
"$schema": "https:/...
1
vote
1
answer
35
views
Is there a way to customize the placement of concatenated charts in Altair?
I have the following chart in Altair, and I was wondering if there is a way to change the orientation of the map chart. I have tried using the "center" and "spacing" parameters, ...
0
votes
1
answer
55
views
follow up question: theta and theta2 chanel encoding by field
this is a follow-up question to my previous question: theta and theta2 chanel encoding by field
Here is a working example, now the data is more complete (5 arcs instead of 1, but 11 are still missing):...
1
vote
1
answer
38
views
theta and theta2 chanel encoding by field
I want to create arcs using vega-lite, here you will find a working example: enter link description here
but this does not work: enter link description here
The difference is only that I use this in ...
2
votes
1
answer
67
views
How can I remove Axis Lines from Vega Lite Chart
I'd like to remove / hide the axis lines from the vega-lite chart below. I've tried changing the colour to null (as below) or other colours and that doesn't work.
https://vega.github.io/editor/#/gist/...
0
votes
1
answer
47
views
Are sparklines possible in Vega-lite and/or Vega?
Came across the following example using D3 yesterday ...
https://observablehq.com/@mbostock/covid-cases-by-state
Is this possible to be replicated in Vega-lite and/or Vega?
1
vote
1
answer
38
views
How to allow AJAX endpoints in mkdocs
Visual is to get this working in mkdocs driven by a local AJAX server.
This one is hard to give an example to but I will. Before I do that, the problem is that I want to use various ajax endpoints to ...
0
votes
1
answer
41
views
Automatically resize Vega map based on lat/long or geojson
I am attempting to create a map option within a data dashboard, where the map will always be of the state of Texas. For that reason, I don't want to give the user the ability to change the scale or ...
0
votes
0
answers
51
views
Vega-Lite "table" using text marks
Trying to replicate the example shown here:
https://observablehq.com/@mdeagen/vega-lite-table-using-text-marks#count
However, when I add the vegalite code to the online editor I get an error because ...
0
votes
0
answers
34
views
Vega-lite trend line based on aggregated mark
I've got a line chart in which i have a line that is aggregated by sum.
I have a trend line based on regression which works fine for the none-aggregated data, but i would like it to show a trend line ...
0
votes
0
answers
28
views
VEGA-lite chart - combined Area and line chart
I trying to make chart who is combine area and line chart. I have Problem with line chart, which are painted only his part. Maybe is problem in the code, or the input data are incorrect. I try some ...
1
vote
2
answers
53
views
Make collective title for columned Altair chart
Good day!
I have this dataset from which I make a columned bar chart.
d = {'year': [2015, 2015, 2015, 2016, 2016, 2016, 2017, 2017, 2017],
'num_pupils': [352, 365, 369, 438, 440, 456, 582, 584, ...
2
votes
1
answer
46
views
Is it possible to transform json key into its own data field in vega-lite?
I'm trying to build a chart from live json data but the format has the date data as the key for other nested data, the essential structure is:
{
"Meta": {
"Frequency": "...
0
votes
0
answers
35
views
How to create a Matrix visual using vega-lite?
For Power-BI I see we have the visual to use vega-lite, I need to create a matrix view below the stacked bar chart. How to create a table / Matrix visual with borders?
1
vote
1
answer
39
views
Altair interactive plots become static on touch screen devices
I made an Altair interactive plot which contains several subplots with cross-filtering and save it as an html file.
When opened on computer browsers, everything works fine. But on my phone and tablet, ...
0
votes
0
answers
21
views
Kibana Vega-Lite plots do not resize as expected
I had to rewrite some visualisations in Kibana with Veg-Lite because they are based on nested fields.
I set the automated resize in the script:
"autosize": {
"type": "fit&...
1
vote
1
answer
53
views
Create multi-line chart on Kibana vega with legend based on inner buckets key values
I had a query response providing the data of format
{
"key_as_string": "2022-02-28T00:00:00.000Z",
"key": 1646006400000,
"doc_count&...
0
votes
1
answer
49
views
How to set miximum for max value displayed on y-axis in vega lite
I want set minimum for maximum value displayed on line chart. For example, it should always display values from 0 to 100 on y-axis, something as follows:
I achieved this with:
vl.y().fieldQ('d').scale(...
1
vote
0
answers
24
views
Keeping a Vega-Lite Schema Local
I was wondering if there was a way to keep a Vega-Lite schema local to a Gitlab project. Right now I've got my graph imbedded in code blocks inside of a .md file. And it works just fine.
{
"$...
0
votes
1
answer
25
views
Sorting in vegalite screws when changing values from fraction to percentage
I have specified sorting in vegalite api as -y as shown below:
vl.markLine().data(video_data).encode(
vl.x()
.fieldN('names') //...