-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Provide regl-based traces in the strict bundle #6083
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 40 commits
Commits
Show all changes
56 commits
Select commit
Hold shift + click to select a range
3b4bbc3
automated codegen
yujin-wu c5624ee
uncommitted generated traces
yujin-wu e958fe8
added strict version of parcoords, scattergl and splom traces, and in…
yujin-wu c9bcfb2
undo changes to dist
yujin-wu ac4f861
added draftlogs entry
yujin-wu aec12ef
removed unused code in codegen tooling, and made it auto exit when co…
yujin-wu 2c8f7c4
handle updated regl cache mechanism
yujin-wu ebd90d5
referenced regl from github PR
yujin-wu 8fbcf15
updated CONTRIBUTING with instructions for npm run regl-codegen
yujin-wu 6748211
added link to codegen location in CONTRIBUTING.md
yujin-wu 8ef4309
clarified some workding in CONTRIBUTING.md
yujin-wu 2ab5976
fixed package lock
yujin-wu b137e09
.
yujin-wu ddf40e1
try with regl that has bumped gl to 4.9.2
yujin-wu 4fcf623
used hash of custom regl instead of branch name
yujin-wu 4c03bb8
Revert "used hash of custom regl instead of branch name"
yujin-wu bb6bdac
used hash of custom regl instead of branch name
yujin-wu 45be643
try node 12 npm 6 and restored reg (oops)
yujin-wu b1b2866
try installing python2.7 first
yujin-wu 7589382
.
yujin-wu 9be5d47
[temporary] try without npm ls
yujin-wu 1ce2919
switched main dev node version from 16 to 12
yujin-wu eb6835b
"
yujin-wu 99bfd0f
updated to regl commit with updated dist
yujin-wu 2022609
changed tests to nodev12, fixed package-lock sha
yujin-wu eaf95a6
corrected package lock and package
yujin-wu d3cf937
convert remaining CI tasks to node 12 for dev
yujin-wu d05deab
try with scoped published package - and restore 'npm ls --prod --all'…
yujin-wu 300a2c0
adjusted package.lock versioning to work with npm 16
yujin-wu 43031cf
fix syntax lint problems
yujin-wu e3bfbde
further lint fixes, and restored try { behavior in prepareRegl
yujin-wu b468c2f
converted devtools/ to es5 syntax
yujin-wu 1b9fef3
try a higher timeout for jasmine tests in _select functio
yujin-wu e73b99f
exclude strict build from no-new-func check
yujin-wu f8548e1
revert usage of node12
yujin-wu 80f6f9e
Merge branch 'master' into regl-build-setup
yujin-wu 5ab56d0
restored custom regl package in package-lock
yujin-wu 0f63027
fixed stability issue in regl, bumped regl, and re-generated regl code
yujin-wu 1b114c4
restored erronously omitted node12 circleci test, removed duplicated …
yujin-wu 666871e
Merge branch 'master' into regl-build-setup
yujin-wu abe7664
scatterpolargl-strict trace
yujin-wu a49b892
Update .circleci/config.yml
yujin-wu b719179
bring back space in circleci config
archmoj 374b086
move strict index files into regl traces
archmoj ec82c09
start with base_index without plot to add strict plot fns
archmoj 862ff3e
lint src/traces/scatterpolargl/plot.js
archmoj 98d49be
revert tasks/partial_bundle.js
archmoj 867c98b
cleanup tasks/util/constants.js
archmoj f94aa45
strict no longer a partial bundle - generate at build step
archmoj 3cecf47
fixup index-strict - cleanup confusing strict traces
archmoj 2ec0545
fixup package-lock
archmoj 501e0a8
fixup trace names in strict bundle
archmoj fd8a303
update draftlogs for next minor
archmoj 3ba7dab
Update tasks/stats.js
archmoj 98702c8
update tasks/stats.js
archmoj e34df29
skip strict in the partial bundle script
archmoj File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,160 @@ | ||
'use strict'; | ||
|
||
/* global Plotly:false */ | ||
|
||
var mocks = require('../../build/test_dashboard_mocks.json'); | ||
var reglTraces = require('../../build/regl_traces.json'); | ||
var Lib = require('@src/lib'); | ||
|
||
// Our gracious testing object | ||
var Tabs = { | ||
|
||
// Return the specified plot container (or default one) | ||
getGraph: function(id) { | ||
id = id || 'graph'; | ||
return document.getElementById(id); | ||
}, | ||
|
||
// Create a new plot container | ||
fresh: function(id) { | ||
id = id || 'graph'; | ||
|
||
var graphDiv = Tabs.getGraph(id); | ||
|
||
if(graphDiv) { | ||
graphDiv.parentNode.removeChild(graphDiv); | ||
} | ||
|
||
graphDiv = document.createElement('div'); | ||
graphDiv.className = 'dashboard-plot'; | ||
graphDiv.id = id; | ||
|
||
var plotArea = document.getElementById('plots'); | ||
plotArea.appendChild(graphDiv); | ||
|
||
return graphDiv; | ||
}, | ||
|
||
// Plot a mock by name (without .json) to the default or specified container | ||
plotMock: function(mockName, id) { | ||
return new Promise(function(res) { | ||
var mockURL = '/test/image/mocks/' + mockName + '.json'; | ||
|
||
console.warn('Plotting:', mockURL); | ||
|
||
var request = new XMLHttpRequest(); | ||
request.open('GET', mockURL, true); | ||
request.responseType = ''; | ||
request.send(); | ||
|
||
request.onreadystatechange = function() { | ||
if(this.readyState === 4) { | ||
if(this.status === 200) { | ||
var fig = JSON.parse(this.responseText); | ||
var graphDiv = Tabs.fresh(id); | ||
|
||
Plotly.newPlot(graphDiv, fig); | ||
|
||
graphDiv.on('plotly_afterplot', function() { | ||
res(graphDiv); | ||
}); | ||
} else { | ||
console.error(this.statusText); | ||
} | ||
} | ||
}; | ||
}); | ||
}, | ||
}; | ||
|
||
|
||
// Bind things to the window | ||
window.Tabs = Tabs; | ||
window.Lib = Lib; | ||
window.onload = handleOnLoad; | ||
setInterval(function() { | ||
window.gd = Tabs.getGraph() || Tabs.fresh(); | ||
window.fullLayout = window.gd._fullLayout; | ||
window.fullData = window.gd._fullData; | ||
}, 1000); | ||
|
||
var mocksList = document.getElementById('mocks-list'); | ||
|
||
function handleOnLoad() { | ||
var mocksByReglTrace = {}; | ||
|
||
reglTraces.forEach(function(trace) { | ||
mocksByReglTrace[trace] = []; | ||
mocks.forEach(function(mock) { | ||
if(mock.keywords.indexOf(trace) !== -1) { | ||
mocksByReglTrace[trace].push(mock); | ||
} | ||
}); | ||
}); | ||
|
||
Object.keys(mocksByReglTrace).forEach(function(trace) { | ||
var thisMocks = mocksByReglTrace[trace]; | ||
var div = document.createElement('div'); | ||
div.className = 'mock-group'; | ||
div.innerHTML = '<h3>' + trace + '</h3>'; | ||
mocksList.appendChild(div); | ||
thisMocks.forEach(function(mock) { | ||
var a = document.createElement('a'); | ||
a.className = 'mock-link'; | ||
a.innerHTML = mock.name; | ||
a.href = '#' + mock.name; | ||
a.onclick = function() { | ||
Tabs.plotMock(this.innerHTML); | ||
}; | ||
div.appendChild(a); | ||
div.appendChild(document.createElement('br')); | ||
}); | ||
}); | ||
|
||
// visit the mocks one by one. | ||
return Object.keys(mocksByReglTrace).reduce(function(p, trace) { | ||
return p.then(function() { | ||
var thisMocks = mocksByReglTrace[trace]; | ||
var generated = {}; | ||
|
||
return thisMocks.reduce(function(p, mock) { | ||
return p.then(function() { | ||
return Tabs.plotMock(mock.name).then(function(gd) { | ||
var fullLayout = gd._fullLayout; | ||
fullLayout._glcanvas.each(function(d) { | ||
if(d.regl) { | ||
console.log('found regl', d.regl); | ||
var cachedCode = d.regl.getCachedCode(); | ||
Object.entries(cachedCode).forEach(function(kv) { | ||
generated[kv[0]] = kv[1].toString(); | ||
}); | ||
console.log('merging entries', Object.keys(cachedCode)); | ||
} | ||
}); | ||
}); | ||
}); | ||
}, Promise.resolve()) | ||
.then(function() { | ||
console.log(window.__regl_codegen_cache); | ||
var body = JSON.stringify({ | ||
generated: generated, | ||
trace: trace | ||
}); | ||
window.__regl_codegen_cache = {}; | ||
return fetch('/api/submit-code', { | ||
method: 'POST', | ||
headers: { | ||
'Content-Type': 'application/json' | ||
}, | ||
body: body | ||
}); | ||
}); | ||
}); | ||
}, Promise.resolve()) | ||
.then(function() { | ||
return fetch('/api/codegen-done'); | ||
}) | ||
.then(function() { | ||
window.close(); | ||
}); | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>REGL Codegen</title> | ||
<link rel="stylesheet" type="text/css" href="//fonts.googleapis.com/css?family=Open+Sans:600,400,300,200|Droid+Sans|PT+Sans+Narrow|Gravitas+One|Droid+Sans+Mono|Droid+Serif|Raleway|Old+Standard+TT"/> | ||
<link rel="stylesheet" type="text/css" href="../test_dashboard/style.css"> | ||
</head> | ||
<body> | ||
<section id="mocks-list"></section> | ||
<div id="plots"> | ||
<div id="graph"></div> | ||
</div> | ||
<div id="snapshot"></div> | ||
|
||
<script src="../../node_modules/mathjax/MathJax.js?config=TeX-AMS-MML_SVG"></script> | ||
<script charset="utf-8" id="source" type="module">import "../../build/plotly.js"</script> | ||
<script charset="utf-8" src="../../build/regl_codegen-bundle.js"></script> | ||
</body> | ||
</html> |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.