vega-lite

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

帅比萌擦擦* 提交于 2021-01-24 07:36:47
问题 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

Correlation matrix not working in new version of Vega?

人走茶凉 提交于 2021-01-07 06:31:53
问题 I was using Elastic 6.6.0 and kibana 6.6.0, vega and vega-lite were not experimental, every thing works good. Now updated to elastic 7.6.0 and kibana 7.6.0 were vega and vega-lite showing experimental, also in version elastic 7.9.3 and kibana 7.9.3. First question, whether experimental can be used for production integration, because don't want that to be dropped out or something after integration. Second, I created a correlation matrix in kibana 6.6.0 Used following code { "$schema": "https:/

Can you dynamically set a color scheme and/or range in Vega-lite?

爱⌒轻易说出口 提交于 2021-01-05 06:29:38
问题 Is it possible dynamically define the color scheme range. For example, I have the below Vega-lite JSON for my color configuration. I would like to input the range below or an entirely different range depending on some condition on the data passed in. Is it possible to set a color range for a variable and dynamically select which one to use? Also if possible, how would you define the logic to select the appropriate color scheme. The logic is whether some condition on the data (value is present

Can you dynamically set a color scheme and/or range in Vega-lite?

你。 提交于 2021-01-05 06:28:47
问题 Is it possible dynamically define the color scheme range. For example, I have the below Vega-lite JSON for my color configuration. I would like to input the range below or an entirely different range depending on some condition on the data passed in. Is it possible to set a color range for a variable and dynamically select which one to use? Also if possible, how would you define the logic to select the appropriate color scheme. The logic is whether some condition on the data (value is present

Altair - Unable to get tooltips for one layer in a line chart

老子叫甜甜 提交于 2021-01-04 06:26:10
问题 When I plot a layered chart consisting of two groups of lines, the tooltips in one layer do not show up. This also occurs in the VL editor. Any insight to why this is happening would be much appreciated. Here is a reproducible example to demonstrate the issue (in reality I have more lines in the first layer): Altair version 4.0.0 df=pd.DataFrame({'school_code': ['AQUI', 'Board'] * 5, 'y4_rate': [.1, .2, .3, .4, .5, .1, .2, .3, .4, .5], 'cohort_year': ['1', '1', '2', '2','3', '3', '4', '4', '5

how can I zoom into a map using vega-lite?

廉价感情. 提交于 2021-01-04 02:30:22
问题 I'm rendering some data onto a map using vega-lite. Currently, I have this schema, which renders the attached image: { "title": "What's the nearest city to you?", "data": { "values": "...", "format": { "type": "csv" } }, "encoding": {}, "projection": { "type": "mercator" }, "layer": [ { "data": { "values": "...", "format": { "type": "topojson", "feature": "world-borders" } }, "mark": { "type": "geoshape", "fill": "lightgrey", "stroke": "darkgrey" }, "width": 800, "height": 600 }, { "mark": {

How can I put a line break in a Vega-lite axis title?

笑着哭i 提交于 2020-12-09 06:03:18
问题 I'm new to Vega-lite and I'm trying to figure out if line breaks are possible in axis titles. I have a long axis titles, e.g.: "Long axis title is too long to fit under the graph" I've tried: "Long axis title is too\n long to fit under the graph" and "Long axis title is too\ long to fit under the graph" The "\n" doesn't seem to do anything. The "\[enter]" just adds extra space to the line. My x and y encoding looks like this: encoding: { x: {field: 'a', type: 'ordinal', sort: {"encoding": "x"

How can I put a line break in a Vega-lite axis title?

旧时模样 提交于 2020-12-09 06:03:10
问题 I'm new to Vega-lite and I'm trying to figure out if line breaks are possible in axis titles. I have a long axis titles, e.g.: "Long axis title is too long to fit under the graph" I've tried: "Long axis title is too\n long to fit under the graph" and "Long axis title is too\ long to fit under the graph" The "\n" doesn't seem to do anything. The "\[enter]" just adds extra space to the line. My x and y encoding looks like this: encoding: { x: {field: 'a', type: 'ordinal', sort: {"encoding": "x"