Skip to content

restyle/relayout refactor #1999

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 43 commits into from
Sep 20, 2017
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
4d3e2ec
test - and fix - most of the relayout doextras
alexcjohnson Aug 18, 2017
95d7d71
test - and fix - most of the doextra calls in restyle
alexcjohnson Aug 29, 2017
3326ecc
test that xaxis-only items are only in the xaxis in the schema
alexcjohnson Aug 30, 2017
a948cce
merge component attribute schemas into core at register time
alexcjohnson Aug 30, 2017
dd52922
fix lib test for undefined -> null in undoqueue
alexcjohnson Sep 1, 2017
f90f079
abstract id/name counter regex and standardize cartesian attrRegex
alexcjohnson Sep 1, 2017
e036fea
fix #1325 - animating multiple axes
alexcjohnson Sep 1, 2017
69e0188
Plotschema getTraceValObject and getLayoutValObject methods
alexcjohnson Sep 1, 2017
bbfe399
relativeAttr
alexcjohnson Sep 12, 2017
29931ec
fix annotation comments/descriptions
alexcjohnson Sep 12, 2017
fad72a2
make common hover label pick up changes quicker
alexcjohnson Sep 13, 2017
e895b32
edit_types.overrideAll
alexcjohnson Sep 13, 2017
7a7dc6d
let PlotSchema.crawl report the complete attribute string
alexcjohnson Sep 13, 2017
c87b01a
better reporting from hover label test
alexcjohnson Sep 13, 2017
658e5cb
fix registry for new circular dep
alexcjohnson Sep 13, 2017
f49ae5e
massive commit to lock in editType and impliedEdits and clean up rest…
alexcjohnson Sep 13, 2017
7ea0d25
lint
alexcjohnson Sep 13, 2017
284c87f
remove obsolete comment in gl3d
alexcjohnson Sep 14, 2017
b9826c8
change overrideAll API to nested/from-root only
alexcjohnson Sep 14, 2017
7c38a4a
clean up restyle/relayout flag names
alexcjohnson Sep 14, 2017
96cc57f
clean up editTypes/impliedEdits and formalize & document their schema…
alexcjohnson Sep 14, 2017
cb94e95
test restrictions on component xaxis/yaxis schemas
alexcjohnson Sep 15, 2017
238e248
preserve impliedEdits: {key: undefined} by extendDeepAll
alexcjohnson Sep 15, 2017
42662ba
comments on relative_attr regexps
alexcjohnson Sep 15, 2017
50aa1ca
include schema in dist
alexcjohnson Sep 15, 2017
62a1392
fix plotschema test for metaKeys
alexcjohnson Sep 15, 2017
87b26d5
test order-independence of trace/transform/component registration
alexcjohnson Sep 18, 2017
040ed1b
test colorbar editing
alexcjohnson Sep 19, 2017
388a7fe
abstract - and fix - automatic axis type clearing
alexcjohnson Sep 19, 2017
6e8a68c
coerceTraceIndices earlier so clearAxisTypes can use it
alexcjohnson Sep 19, 2017
4f8fc66
move clearAxisTypes into helpers
alexcjohnson Sep 19, 2017
97ddf48
update jsdom to v11.2 with new API
alexcjohnson Sep 19, 2017
fe7db79
oops didn't mean to commit that commented out...
alexcjohnson Sep 19, 2017
68f5dbc
fix and test errorbar visibility toggling
alexcjohnson Sep 19, 2017
d15e541
layout.showlegend test
alexcjohnson Sep 19, 2017
7ec1634
closes #615 - something else in this PR fixed it, just nailing a test
alexcjohnson Sep 19, 2017
a107466
fix #358 - restyling orientation
alexcjohnson Sep 20, 2017
42805c2
test histogram changing data type
alexcjohnson Sep 20, 2017
8d9feaf
fix #2020 - editing plots with multiple histograms
alexcjohnson Sep 20, 2017
0a98a6d
lint
alexcjohnson Sep 20, 2017
e4227aa
move checkTicks into custom_assertions
alexcjohnson Sep 20, 2017
0729921
load custom_matchers globally, and refactor negateIf as a method
alexcjohnson Sep 20, 2017
407ae5a
pull custom_matchers out of requirejs bundle test
alexcjohnson Sep 20, 2017
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
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@
"gzip-size": "^3.0.0",
"image-size": "^0.5.1",
"jasmine-core": "^2.4.1",
"jsdom": "^9.5.0",
"jsdom": "^11.2.0",
"karma": "^1.5.0",
"karma-browserify": "^5.1.1",
"karma-chrome-launcher": "^2.0.0",
Expand Down
50 changes: 25 additions & 25 deletions tasks/bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,25 +18,25 @@ var DEV = (arg === 'dev') || (arg === '--dev');


// Check if style and font build files are there
var doesFileExist = common.doesFileExist;
if(!doesFileExist(constants.pathToCSSBuild) || !doesFileExist(constants.pathToFontSVG)) {
throw new Error([
'build/ is missing one or more files',
'Please run `npm run preprocess` first'
].join('\n'));
}
// var doesFileExist = common.doesFileExist;
// if(!doesFileExist(constants.pathToCSSBuild) || !doesFileExist(constants.pathToFontSVG)) {
// throw new Error([
// 'build/ is missing one or more files',
// 'Please run `npm run preprocess` first'
// ].join('\n'));
// }

// Browserify plotly.js
_bundle(constants.pathToPlotlyIndex, constants.pathToPlotlyDist, {
standalone: 'Plotly',
debug: DEV,
pathToMinBundle: constants.pathToPlotlyDistMin
});
// // Browserify plotly.js
// _bundle(constants.pathToPlotlyIndex, constants.pathToPlotlyDist, {
// standalone: 'Plotly',
// debug: DEV,
// pathToMinBundle: constants.pathToPlotlyDistMin
// });

// Browserify the geo assets
_bundle(constants.pathToPlotlyGeoAssetsSrc, constants.pathToPlotlyGeoAssetsDist, {
standalone: 'PlotlyGeoAssets'
});
// // Browserify the geo assets
// _bundle(constants.pathToPlotlyGeoAssetsSrc, constants.pathToPlotlyGeoAssetsDist, {
// standalone: 'PlotlyGeoAssets'
// });

// Browserify the plotly.js with meta
_bundle(constants.pathToPlotlyIndex, constants.pathToPlotlyDistWithMeta, {
Expand All @@ -45,11 +45,11 @@ _bundle(constants.pathToPlotlyIndex, constants.pathToPlotlyDistWithMeta, {
then: makeSchema(constants.pathToPlotlyDistWithMeta, constants.pathToSchema)
});

// Browserify the plotly.js partial bundles
constants.partialBundlePaths.forEach(function(pathObj) {
_bundle(pathObj.index, pathObj.dist, {
standalone: 'Plotly',
debug: DEV,
pathToMinBundle: pathObj.distMin
});
});
// // Browserify the plotly.js partial bundles
// constants.partialBundlePaths.forEach(function(pathObj) {
// _bundle(pathObj.index, pathObj.dist, {
// standalone: 'Plotly',
// debug: DEV,
// pathToMinBundle: pathObj.distMin
// });
// });
29 changes: 14 additions & 15 deletions tasks/util/make_schema.js
Original file line number Diff line number Diff line change
@@ -1,25 +1,24 @@
var fs = require('fs');
var path = require('path');
var jsdom = require('jsdom');
var JSDOM = require('jsdom').JSDOM;

module.exports = function makeSchema(plotlyPath, schemaPath) {
return function() {
var plotlyjsCode = fs.readFileSync(plotlyPath, 'utf-8');
jsdom.env({
html: '<div></div>',
src: [plotlyjsCode],
done: function(err, window) {
if(err) {
console.log(err);
return;
}

var plotSchema = window.Plotly.PlotSchema.get();
var plotSchemaStr = JSON.stringify(plotSchema, null, 4);
fs.writeFileSync(schemaPath, plotSchemaStr);
var w = new JSDOM('', {runScripts: 'dangerously'}).window;

console.log('ok ' + path.basename(schemaPath));
}
});
// jsdom by itself doesn't support getContext, and adding the npm canvas
// package is annoying and platform-dependent.
// see https://github.com/tmpvar/jsdom/issues/1782
w.HTMLCanvasElement.prototype.getContext = function() { return null; };
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

dunno why it didn't happen with the old version, but with the new jsdom without this patch you get an ugly but nonblocking error Error: Not implemented: HTMLCanvasElement.prototype.getContext (without installing the canvas npm package)

Copy link
Contributor

Choose a reason for hiding this comment

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

Yep, no need to add a dependency for this 👌


w.eval(plotlyjsCode);

var plotSchema = w.Plotly.PlotSchema.get();
var plotSchemaStr = JSON.stringify(plotSchema, null, 4);
fs.writeFileSync(schemaPath, plotSchemaStr);

console.log('ok ' + path.basename(schemaPath));
};
};