mirror of
https://github.com/lana-k/sqliteviz.git
synced 2026-02-04 15:38:55 +08:00
Compare commits
2 Commits
c5fcddc29e
...
b93774b743
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b93774b743 | ||
|
|
7aa61f3f74 |
2
Graph.md
2
Graph.md
@@ -207,6 +207,6 @@ clicking `Start`/`Stop` button.
|
||||
|
||||

|
||||
|
||||
[1]: ./How-to-get-result-set-suitable-for-graph-visualisation
|
||||
[1]: ../How-to-get-result-set-suitable-for-graph-visualisation
|
||||
[2]: https://www.w3.org/TR/css-color-4/#named-colors
|
||||
[3]: https://journals.plos.org/plosone/article?id=10.1371/journal.pone.0098679
|
||||
|
||||
33
How-to-work-with-plotly-interactive-selection.md
Normal file
33
How-to-work-with-plotly-interactive-selection.md
Normal file
@@ -0,0 +1,33 @@
|
||||
# How to work with Plotly interactive selection
|
||||
|
||||
Plotly supports interactive selection on some chart types, like scatterplot,
|
||||
where you can select a subset of the points. It may be helpful for live
|
||||
presentation purposes, but there's no UI to interact with it if you want to
|
||||
compute something from the selection, like the count of points.
|
||||
|
||||

|
||||
|
||||
This page proposes a workaround with browser console. Right click on the Plotly
|
||||
chart and select *Inspect* in the context menu. In the opened browser DOM
|
||||
inspector scroll up and find the chart's container, matching
|
||||
`div.js-plotly-plot` CSS selector. Right click and select *Use in console* or
|
||||
*Set as global variable* (depending on the browser). Then in *Console* tab paste
|
||||
the following snippet (adjust to your needs):
|
||||
|
||||
```javascript
|
||||
temp0.on('plotly_selected', function(eventData) {
|
||||
if (eventData) {
|
||||
const start = Date.parse(eventData.range.x[0])
|
||||
const finish = Date.parse(eventData.range.x[1])
|
||||
console.log('---------- Selected points ----------')
|
||||
console.log('Range, s:', (finish - start) / 1000)
|
||||
console.log('Count:', eventData.points.length)
|
||||
}
|
||||
})
|
||||
```
|
||||
|
||||
To update set listener, first unset the existing one with:
|
||||
|
||||
```javascript
|
||||
temp0.removeAllListeners('plotly_selected')
|
||||
```
|
||||
BIN
img/Screenshot_plotly_selection.png
Normal file
BIN
img/Screenshot_plotly_selection.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 202 KiB |
69
sidebar.json
69
sidebar.json
@@ -1,33 +1,36 @@
|
||||
[{
|
||||
"sections": [{
|
||||
"title": "For users",
|
||||
"items": [
|
||||
"/docs/",
|
||||
"/docs/installation/",
|
||||
"/docs/basic-usage/",
|
||||
"/docs/multiple-csv-file-import/",
|
||||
"/docs/manage-inquiries/",
|
||||
"/docs/export-current-database/",
|
||||
"/docs/graph/",
|
||||
"/docs/pivot-table/",
|
||||
"/docs/predefined-inquiries/",
|
||||
"/docs/sharing/",
|
||||
"/docs/diagnostic-information/"
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "Examples and tutorials",
|
||||
"items": [
|
||||
"/docs/how-to-migrate-to-sqliteviz-dot-com/",
|
||||
"/docs/how-to-build-a-pivot-table-in-sq-lite/",
|
||||
"/docs/how-to-rename-tables-and-columns-after-csv-import/"
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "For developers",
|
||||
"items": [
|
||||
"/docs/integrate-predefined-inquiries/"
|
||||
]
|
||||
}
|
||||
]
|
||||
}]
|
||||
[
|
||||
{
|
||||
"sections": [
|
||||
{
|
||||
"title": "For users",
|
||||
"items": [
|
||||
"/docs/",
|
||||
"/docs/installation/",
|
||||
"/docs/basic-usage/",
|
||||
"/docs/multiple-csv-file-import/",
|
||||
"/docs/manage-inquiries/",
|
||||
"/docs/export-current-database/",
|
||||
"/docs/graph/",
|
||||
"/docs/pivot-table/",
|
||||
"/docs/predefined-inquiries/",
|
||||
"/docs/sharing/",
|
||||
"/docs/diagnostic-information/"
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "Examples and tutorials",
|
||||
"items": [
|
||||
"/docs/how-to-migrate-to-sqliteviz-dot-com/",
|
||||
"/docs/how-to-build-a-pivot-table-in-sq-lite/",
|
||||
"/docs/how-to-rename-tables-and-columns-after-csv-import/",
|
||||
"/docs/how-to-work-with-plotly-interactive-selection/",
|
||||
"/docs/how-to-get-result-set-suitable-for-graph-visualisation/"
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "For developers",
|
||||
"items": ["/docs/integrate-predefined-inquiries/"]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user