Skip to content

Use topojson input from node_modules/sane-topojson #5492

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 4 commits into from
Feb 11, 2021
Merged
Show file tree
Hide file tree
Changes from 2 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
3 changes: 2 additions & 1 deletion devtools/test_dashboard/devtools.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
var Fuse = require('fuse.js/dist/fuse.common.js');
var mocks = require('../../build/test_dashboard_mocks.json');
var credentials = require('../../build/credentials.json');
var constants = require('@src/plots/geo/constants');
Copy link
Collaborator

Choose a reason for hiding this comment

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

don't you want tasks/util/constants?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is exactly the same as what is used in geo_test

var constants = require('@src/plots/geo/constants');

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You are right. We are not really using local files here and in geo_test on this branch.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch!
Fixed in 343faa8.

var Lib = require('@src/lib');
var d3 = require('../../test/strict-d3');
var d3Json = d3.json;
Expand All @@ -19,7 +20,7 @@ var Tabs = {
Plotly.setPlotConfig({

// use local topojson files
topojsonURL: '../../vendor/topojson/',
topojsonURL: constants.pathToTopojsonSrc,

// register mapbox access token
// run `npm run preset` if you haven't yet
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@
"plotly"
],
"scripts": {
"preprocess": "node tasks/preprocess.js",
"bundle": "node tasks/bundle.js",
"header-dist": "node tasks/header_dist.js",
"stats": "node tasks/stats.js",
"find-strings": "node tasks/find_locale_strings.js",
"build": "node tasks/empty_dist.js && npm run preprocess && node tasks/topojson_dist.js && npm run find-strings && npm run bundle && npm run header-dist && npm run stats",
"preprocess": "node tasks/preprocess.js",
"build": "node tasks/empty_dist.js && npm run preprocess && npm run find-strings && npm run bundle && npm run header-dist && npm run stats",
"cibuild": "node tasks/empty_dist.js && npm run preprocess && node tasks/cibundle.js",
"watch": "node tasks/watch.js",
"lint": "eslint --version && eslint .",
Expand Down
4 changes: 2 additions & 2 deletions tasks/preprocess.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ function makeBuildCSS() {
});
}

// copy topojson files from sane-topojson to vendor/
// copy topojson files from sane-topojson to dist/
function copyTopojsonFiles() {
fs.copy(
constants.pathToTopojsonSrc,
constants.pathToTopojsonVendor,
constants.pathToTopojsonDist,
{ clobber: true },
common.throwOnError
);
Expand Down
16 changes: 0 additions & 16 deletions tasks/topojson_dist.js

This file was deleted.

1 change: 0 additions & 1 deletion tasks/util/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ module.exports = {

pathToTopojsonSrc: pathToTopojsonSrc,
pathToTopojsonDist: path.join(pathToDist, 'topojson/'),
pathToTopojsonVendor: path.join(pathToVendor, 'topojson/'),
pathToPlotlyGeoAssetsSrc: path.join(pathToSrc, 'assets/geo_assets.js'),
pathToPlotlyGeoAssetsDist: path.join(pathToDist, 'plotly-geo-assets.js'),

Expand Down
2 changes: 1 addition & 1 deletion test/jasmine/tests/geo_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ var HOVERMINTIME = require('@src/components/fx').constants.HOVERMINTIME;

// use local topojson files
Plotly.setPlotConfig({
topojsonURL: '/base/vendor/topojson/'
topojsonURL: constants.pathToTopojsonSrc
});

function move(fromX, fromY, toX, toY, delay) {
Expand Down
1 change: 0 additions & 1 deletion vendor/topojson/africa_110m.json

This file was deleted.

1 change: 0 additions & 1 deletion vendor/topojson/africa_50m.json

This file was deleted.

1 change: 0 additions & 1 deletion vendor/topojson/asia_110m.json

This file was deleted.

1 change: 0 additions & 1 deletion vendor/topojson/asia_50m.json

This file was deleted.

1 change: 0 additions & 1 deletion vendor/topojson/europe_110m.json

This file was deleted.

1 change: 0 additions & 1 deletion vendor/topojson/europe_50m.json

This file was deleted.

1 change: 0 additions & 1 deletion vendor/topojson/north-america_110m.json

This file was deleted.

1 change: 0 additions & 1 deletion vendor/topojson/north-america_50m.json

This file was deleted.

1 change: 0 additions & 1 deletion vendor/topojson/south-america_110m.json

This file was deleted.

1 change: 0 additions & 1 deletion vendor/topojson/south-america_50m.json

This file was deleted.

1 change: 0 additions & 1 deletion vendor/topojson/usa_110m.json

This file was deleted.

1 change: 0 additions & 1 deletion vendor/topojson/usa_50m.json

This file was deleted.

1 change: 0 additions & 1 deletion vendor/topojson/world_110m.json

This file was deleted.

1 change: 0 additions & 1 deletion vendor/topojson/world_50m.json

This file was deleted.