gl-vis / regl-splom Goto Github PK
View Code? Open in Web Editor NEWMatrix of scatter2d plots
Home Page: https://dy.github.io/regl-splom
License: MIT License
Matrix of scatter2d plots
Home Page: https://dy.github.io/regl-splom
License: MIT License
here:
https://github.com/dy/regl-splom/blob/70d118e451d147eb4892a8eec2c56fe572dd581b/index.js#L132
which is likely to break in Safari.
const regl = require('regl')({ extensions: 'oes_element_index_uint' })
const createMatrix = require('./')
// create splom instance
let splom = createMatrix(regl)
splom.update({
data: [
[1, 2, 3],
[4, 6, 8]
],
ranges: [
[0, 10],
[0, 10]
]
})
splom.draw()
setTimeout(() => {
splom.destroy()
}, 2000)
spits out
cc @dfcreative
Consider:
const regl = require('regl')({ extensions: 'oes_element_index_uint' })
const createMatrix = require('./')
let splom = createMatrix(regl)
splom.update({
data: [
new Float32Array([1, 2, 3]),
new Float32Array([4, 6, 8]),
new Float32Array([1, 5, 9])
],
ranges: [
[0, 10],
[0, 10],
[0, 10]
],
domain: [
[0, 0, 0.3, 0.3],
[0.35, 0.35, 0.65, 0.65],
[0.7, 0.7, 1, 1]
],
color: ['red', 'green', 'blue'],
size: [20, 10, 30]
})
splom.draw()
this gives:
and a blank screen.
Is this a known limitation of this implementation? That is, should we try to convert typed array to plain arrays in plotly.js? Or would there be an easy way to make regl-splom accept typed arrays?
from any splom mock off plotly/plotly.js#2505 then calling Plotly.purge(gd)
(which calls splom.destroy
) gives:
From
const regl = require('regl')({ extensions: 'oes_element_index_uint' })
const createMatrix = require('./')
// create splom instance
let splom = createMatrix(regl)
splom.update({
data: [
[1, 2, 3],
[4, 6, 8]
],
ranges: [
[0, 10],
[0, 10]
]
})
splom.draw()
I get:
where the the top-left panel which is supposed to plot x=[1,2,3]
vs y=[4,6,8]
is plotting instead x=[4,6,8]
vs y=[1,2,3]
and similarly for the bottom-right panel.
SDF markers (as in regl-scatter2d) don't seem to be supported.
Consider:
const regl = require('regl')({ extensions: 'oes_element_index_uint' })
const createMatrix = require('./')
let splom = createMatrix(regl)
splom.update({
data: [
[1, 2, 3],
[4, 6, 8],
[1, 5, 9]
],
ranges: [
[0, 10],
[0, 10],
[0, 10]
],
domain: [
[0, 0, 0.3, 0.3],
[0.35, 0.35, 0.65, 0.65],
[0.7, 0.7, 1, 1]
],
diagonal: false,
upper: false
})
splom.draw()
where data
, ranges
and domains
have the same length - this generates:
Now, if we want to just draw the three non-empty, how should we go about it? In this case, data
should still be 3x3 both now there are only 2 x and 2 y axes.
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.