Skip to content
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

Regenerate functions for regl-based traces in the strict bundle #6141

Merged
merged 2 commits into from
Mar 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 7 additions & 20 deletions devtools/regl_codegen/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,13 @@ var devtools = browserify(path.join(devtoolsPath, 'devtools.js'), {
// Start the server up!
server.listen(PORT);

var reglTraceList = getReglTraces();
var reglTraceList = [
'parcoords',
'scattergl',
'scatterpolargl',
'splom'
];

purgeGeneratedCode(reglTraceList);

// Build and bundle all the things!
Expand All @@ -91,25 +97,6 @@ function getMockFiles() {
});
}

function getReglTraces() {
return constants.allTraces.filter(function(trace) {
var indexPath = constants.pathToSrc + '/traces/' + trace + '/index.js';

// get categories
var indexContents = fs.readFileSync(indexPath, 'utf8');
var categories = indexContents.match(/^\s*categories:\s*\[([^\]]+)\]/m);
if(categories) {
categories = categories[1].split(',').map(function(c) {
return c.trim().replace(/^['"]|['"]$/g, '');
});
}

if(categories && categories.indexOf('regl') !== -1) {
return true;
}
});
}

function readFiles(files) {
var promises = files.map(function(file) {
var filePath = path.join(constants.pathToTestImageMocks, file);
Expand Down
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@
"parse-svg-path": "^0.1.2",
"polybooljs": "^1.2.0",
"probe-image-size": "^7.2.3",
"regl": "npm:@plotly/regl@^2.1.1",
"regl": "npm:@plotly/regl@^2.1.2",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"regl-error2d": "^2.0.12",
"regl-line2d": "^3.1.2",
"regl-scatter2d": "^3.2.8",
Expand Down
Loading