Skip to content

Commit dc90a91

Browse files
Merge pull request #164 from plotly/move-node-sass-to-dev-deps
Move node-sass to devdeps and remove postinstall npm command
2 parents f8a9a8d + e8234a3 commit dc90a91

File tree

6 files changed

+177
-7
lines changed

6 files changed

+177
-7
lines changed

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
node_modules
22

33
build/*
4+
5+
!build/plotcss.js
6+
!build/ploticon.js
47
!build/README.md
58

69
npm-debug.log

.npmignore

+3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
build/*
2+
3+
!build/plotcss.js
4+
!build/ploticon.js
25
!build/README.md
36

47
devtools

build/plotcss.js

+57
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
'use strict';
2+
3+
var Plotly = require('../src/plotly');
4+
var rules = {
5+
"X,X div": "font-family:'Open Sans', verdana, arial, sans-serif;margin:0;padding:0;",
6+
"X input,X button": "font-family:'Open Sans', verdana, arial, sans-serif;",
7+
"X input:focus,X button:focus": "outline:none;",
8+
"X a": "text-decoration:none;",
9+
"X a:hover": "text-decoration:none;",
10+
"X .crisp": "shape-rendering:crispEdges;",
11+
"X svg a": "fill:#447adb;",
12+
"X svg a:hover": "fill:#3c6dc5;",
13+
"X .main-svg": "position:absolute;top:0;left:0;pointer-events:none;",
14+
"X .main-svg .draglayer": "pointer-events:all;",
15+
"X .cursor-pointer": "cursor:pointer;",
16+
"X .cursor-crosshair": "cursor:crosshair;",
17+
"X .cursor-move": "cursor:move;",
18+
"X .cursor-col-resize": "cursor:col-resize;",
19+
"X .cursor-row-resize": "cursor:row-resize;",
20+
"X .cursor-ns-resize": "cursor:ns-resize;",
21+
"X .cursor-ew-resize": "cursor:ew-resize;",
22+
"X .cursor-sw-resize": "cursor:sw-resize;",
23+
"X .cursor-s-resize": "cursor:s-resize;",
24+
"X .cursor-se-resize": "cursor:se-resize;",
25+
"X .cursor-w-resize": "cursor:w-resize;",
26+
"X .cursor-e-resize": "cursor:e-resize;",
27+
"X .cursor-nw-resize": "cursor:nw-resize;",
28+
"X .cursor-n-resize": "cursor:n-resize;",
29+
"X .cursor-ne-resize": "cursor:ne-resize;",
30+
"X .modebar": "position:absolute;top:2px;right:2px;z-index:1001;background:rgba(255,255,255,0.7);",
31+
"X .modebar--hover": "opacity:0;-webkit-transition:opacity 0.3s ease 0s;-moz-transition:opacity 0.3s ease 0s;-ms-transition:opacity 0.3s ease 0s;-o-transition:opacity 0.3s ease 0s;transition:opacity 0.3s ease 0s;",
32+
"X:hover .modebar--hover": "opacity:1;",
33+
"X .modebar-group": "float:left;display:inline-block;box-sizing:border-box;margin-left:8px;position:relative;vertical-align:middle;white-space:nowrap;",
34+
"X .modebar-group:first-child": "margin-left:0px;",
35+
"X .modebar-btn": "position:relative;font-size:16px;padding:3px 4px;cursor:pointer;line-height:normal;box-sizing:border-box;",
36+
"X .modebar-btn svg": "position:relative;top:2px;",
37+
"X .modebar-btn path": "fill:rgba(0,31,95,0.3);",
38+
"X .modebar-btn.active path,X .modebar-btn:hover path": "fill:rgba(0,22,72,0.5);",
39+
"X .modebar-btn.modebar-btn--logo": "padding:3px 1px;",
40+
"X .modebar-btn.modebar-btn--logo path": "fill:#447adb !important;",
41+
"X [data-title]:before,X [data-title]:after": "position:absolute;-webkit-transform:translate3d(0, 0, 0);-moz-transform:translate3d(0, 0, 0);-ms-transform:translate3d(0, 0, 0);-o-transform:translate3d(0, 0, 0);transform:translate3d(0, 0, 0);display:none;opacity:0;z-index:1001;pointer-events:none;top:110%;right:50%;",
42+
"X [data-title]:hover:before,X [data-title]:hover:after": "display:block;opacity:1;",
43+
"X [data-title]:before": "content:'';position:absolute;background:transparent;border:6px solid transparent;z-index:1002;margin-top:-12px;border-bottom-color:#69738a;margin-right:-6px;",
44+
"X [data-title]:after": "content:attr(data-title);background:#69738a;color:white;padding:8px 10px;font-size:12px;line-height:12px;white-space:nowrap;margin-right:-18px;border-radius:2px;",
45+
Y: "font-family:'Open Sans';position:fixed;top:50px;right:20px;z-index:10000;font-size:10pt;max-width:180px;",
46+
"Y p": "margin:0;",
47+
"Y .notifier-note": "min-width:180px;max-width:250px;border:1px solid #fff;z-index:3000;margin:0;background-color:#8c97af;background-color:rgba(140,151,175,0.9);color:#fff;padding:10px;",
48+
"Y .notifier-close": "color:#fff;opacity:0.8;float:right;padding:0 5px;background:none;border:none;font-size:20px;font-weight:bold;line-height:20px;",
49+
"Y .notifier-close:hover": "color:#444;text-decoration:none;cursor:pointer;"
50+
};
51+
52+
for(var selector in rules) {
53+
var fullSelector = selector.replace(/^,/,' ,')
54+
.replace(/X/g, '.js-plotly-plot .plotly')
55+
.replace(/Y/g, '.plotly-notifier');
56+
Plotly.Lib.addStyleRule(fullSelector, rules[selector]);
57+
}

build/ploticon.js

+108
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
/* jshint quotmark:true */
2+
3+
'use strict';
4+
5+
module.exports = {
6+
'undo': {
7+
'width': 857.1,
8+
'path': 'm857 350q0-87-34-166t-91-137-137-92-166-34q-96 0-183 41t-147 114q-4 6-4 13t5 11l76 77q6 5 14 5 9-1 13-7 41-53 100-82t126-29q58 0 110 23t92 61 61 91 22 111-22 111-61 91-92 61-110 23q-55 0-105-20t-90-57l77-77q17-16 8-38-10-23-33-23h-250q-15 0-25 11t-11 25v250q0 24 22 33 22 10 39-8l72-72q60 57 137 88t159 31q87 0 166-34t137-92 91-137 34-166z',
9+
'ascent': 850,
10+
'descent': -150
11+
},
12+
'home': {
13+
'width': 928.6,
14+
'path': 'm786 296v-267q0-15-11-26t-25-10h-214v214h-143v-214h-214q-15 0-25 10t-11 26v267q0 1 0 2t0 2l321 264 321-264q1-1 1-4z m124 39l-34-41q-5-5-12-6h-2q-7 0-12 3l-386 322-386-322q-7-4-13-4-7 2-12 7l-35 41q-4 5-3 13t6 12l401 334q18 15 42 15t43-15l136-114v109q0 8 5 13t13 5h107q8 0 13-5t5-13v-227l122-102q5-5 6-12t-4-13z',
15+
'ascent': 850,
16+
'descent': -150
17+
},
18+
'camera-retro': {
19+
'width': 1000,
20+
'path': 'm518 386q0 8-5 13t-13 5q-37 0-63-27t-26-63q0-8 5-13t13-5 12 5 5 13q0 23 16 38t38 16q8 0 13 5t5 13z m125-73q0-59-42-101t-101-42-101 42-42 101 42 101 101 42 101-42 42-101z m-572-320h858v71h-858v-71z m643 320q0 89-62 152t-152 62-151-62-63-152 63-151 151-63 152 63 62 151z m-571 358h214v72h-214v-72z m-72-107h858v143h-462l-36-71h-360v-72z m929 143v-714q0-30-21-51t-50-21h-858q-29 0-50 21t-21 51v714q0 30 21 51t50 21h858q29 0 50-21t21-51z',
21+
'ascent': 850,
22+
'descent': -150
23+
},
24+
'zoombox': {
25+
'width': 1000,
26+
'path': 'm1000-25l-250 251c40 63 63 138 63 218 0 224-182 406-407 406-224 0-406-182-406-406s183-406 407-406c80 0 155 22 218 62l250-250 125 125z m-812 250l0 438 437 0 0-438-437 0z m62 375l313 0 0-312-313 0 0 312z',
27+
'ascent': 850,
28+
'descent': -150
29+
},
30+
'pan': {
31+
'width': 1000,
32+
'path': 'm1000 350l-187 188 0-125-250 0 0 250 125 0-188 187-187-187 125 0 0-250-250 0 0 125-188-188 186-187 0 125 252 0 0-250-125 0 187-188 188 188-125 0 0 250 250 0 0-126 187 188z',
33+
'ascent': 850,
34+
'descent': -150
35+
},
36+
'zoom_plus': {
37+
'width': 1000,
38+
'path': 'm1 787l0-875 875 0 0 875-875 0z m687-500l-187 0 0-187-125 0 0 187-188 0 0 125 188 0 0 187 125 0 0-187 187 0 0-125z',
39+
'ascent': 850,
40+
'descent': -150
41+
},
42+
'zoom_minus': {
43+
'width': 1000,
44+
'path': 'm0 788l0-876 875 0 0 876-875 0z m688-500l-500 0 0 125 500 0 0-125z',
45+
'ascent': 850,
46+
'descent': -150
47+
},
48+
'autoscale': {
49+
'width': 1000,
50+
'path': 'm250 850l-187 0-63 0 0-62 0-188 63 0 0 188 187 0 0 62z m688 0l-188 0 0-62 188 0 0-188 62 0 0 188 0 62-62 0z m-875-938l0 188-63 0 0-188 0-62 63 0 187 0 0 62-187 0z m875 188l0-188-188 0 0-62 188 0 62 0 0 62 0 188-62 0z m-125 188l-1 0-93-94-156 156 156 156 92-93 2 0 0 250-250 0 0-2 93-92-156-156-156 156 94 92 0 2-250 0 0-250 0 0 93 93 157-156-157-156-93 94 0 0 0-250 250 0 0 0-94 93 156 157 156-157-93-93 0 0 250 0 0 250z',
51+
'ascent': 850,
52+
'descent': -150
53+
},
54+
'tooltip_basic': {
55+
'width': 1500,
56+
'path': 'm375 725l0 0-375-375 375-374 0-1 1125 0 0 750-1125 0z',
57+
'ascent': 850,
58+
'descent': -150
59+
},
60+
'tooltip_compare': {
61+
'width': 1125,
62+
'path': 'm187 786l0 2-187-188 188-187 0 0 937 0 0 373-938 0z m0-499l0 1-187-188 188-188 0 0 937 0 0 376-938-1z',
63+
'ascent': 850,
64+
'descent': -150
65+
},
66+
'plotlylogo': {
67+
'width': 1542,
68+
'path': 'm0-10h182v-140h-182v140z m228 146h183v-286h-183v286z m225 714h182v-1000h-182v1000z m225-285h182v-715h-182v715z m225 142h183v-857h-183v857z m231-428h182v-429h-182v429z m225-291h183v-138h-183v138z',
69+
'ascent': 850,
70+
'descent': -150
71+
},
72+
'z-axis': {
73+
'width': 1000,
74+
'path': 'm833 5l-17 108v41l-130-65 130-66c0 0 0 38 0 39 0-1 36-14 39-25 4-15-6-22-16-30-15-12-39-16-56-20-90-22-187-23-279-23-261 0-341 34-353 59 3 60 228 110 228 110-140-8-351-35-351-116 0-120 293-142 474-142 155 0 477 22 477 142 0 50-74 79-163 96z m-374 94c-58-5-99-21-99-40 0-24 65-43 144-43 79 0 143 19 143 43 0 19-42 34-98 40v216h87l-132 135-133-135h88v-216z m167 515h-136v1c16 16 31 34 46 52l84 109v54h-230v-71h124v-1c-16-17-28-32-44-51l-89-114v-51h245v72z',
75+
'ascent': 850,
76+
'descent': -150
77+
},
78+
'3d_rotate': {
79+
'width': 1000,
80+
'path': 'm922 660c-5 4-9 7-14 11-359 263-580-31-580-31l-102 28 58-400c0 1 1 1 2 2 118 108 351 249 351 249s-62 27-100 42c88 83 222 183 347 122 16-8 30-17 44-27-2 1-4 2-6 4z m36-329c0 0 64 229-88 296-62 27-124 14-175-11 157-78 225-208 249-266 8-19 11-31 11-31 2 5 6 15 11 32-5-13-8-20-8-20z m-775-239c70-31 117-50 198-32-121 80-199 346-199 346l-96-15-58-12c0 0 55-226 155-287z m603 133l-317-139c0 0 4-4 19-14 7-5 24-15 24-15s-177-147-389 4c235-287 536-112 536-112l31-22 100 299-4-1z m-298-153c6-4 14-9 24-15 0 0-17 10-24 15z',
81+
'ascent': 850,
82+
'descent': -150
83+
},
84+
'camera': {
85+
'width': 1000,
86+
'path': 'm500 450c-83 0-150-67-150-150 0-83 67-150 150-150 83 0 150 67 150 150 0 83-67 150-150 150z m400 150h-120c-16 0-34 13-39 29l-31 93c-6 15-23 28-40 28h-340c-16 0-34-13-39-28l-31-94c-6-15-23-28-40-28h-120c-55 0-100-45-100-100v-450c0-55 45-100 100-100h800c55 0 100 45 100 100v450c0 55-45 100-100 100z m-400-550c-138 0-250 112-250 250 0 138 112 250 250 250 138 0 250-112 250-250 0-138-112-250-250-250z m365 380c-19 0-35 16-35 35 0 19 16 35 35 35 19 0 35-16 35-35 0-19-16-35-35-35z',
87+
'ascent': 850,
88+
'descent': -150
89+
},
90+
'movie': {
91+
'width': 1000,
92+
'path': 'm938 413l-188-125c0 37-17 71-44 94 64 38 107 107 107 187 0 121-98 219-219 219-121 0-219-98-219-219 0-61 25-117 66-156h-115c30 33 49 76 49 125 0 103-84 187-187 187s-188-84-188-187c0-57 26-107 65-141-38-22-65-62-65-109v-250c0-70 56-126 125-126h500c69 0 125 56 125 126l188-126c34 0 62 28 62 63v375c0 35-28 63-62 63z m-750 0c-69 0-125 56-125 125s56 125 125 125 125-56 125-125-56-125-125-125z m406-1c-87 0-157 70-157 157 0 86 70 156 157 156s156-70 156-156-70-157-156-157z',
93+
'ascent': 850,
94+
'descent': -150
95+
},
96+
'question': {
97+
'width': 857.1,
98+
'path': 'm500 82v107q0 8-5 13t-13 5h-107q-8 0-13-5t-5-13v-107q0-8 5-13t13-5h107q8 0 13 5t5 13z m143 375q0 49-31 91t-77 65-95 23q-136 0-207-119-9-14 4-24l74-55q4-4 10-4 9 0 14 7 30 38 48 51 19 14 48 14 27 0 48-15t21-33q0-21-11-34t-38-25q-35-16-65-48t-29-70v-20q0-8 5-13t13-5h107q8 0 13 5t5 13q0 10 12 27t30 28q18 10 28 16t25 19 25 27 16 34 7 45z m214-107q0-117-57-215t-156-156-215-58-216 58-155 156-58 215 58 215 155 156 216 58 215-58 156-156 57-215z',
99+
'ascent': 850,
100+
'descent': -150
101+
},
102+
'disk': {
103+
'width': 857.1,
104+
'path': 'm214-7h429v214h-429v-214z m500 0h72v500q0 8-6 21t-11 20l-157 156q-5 6-19 12t-22 5v-232q0-22-15-38t-38-16h-322q-22 0-37 16t-16 38v232h-72v-714h72v232q0 22 16 38t37 16h465q22 0 38-16t15-38v-232z m-214 518v178q0 8-5 13t-13 5h-107q-7 0-13-5t-5-13v-178q0-8 5-13t13-5h107q7 0 13 5t5 13z m357-18v-518q0-22-15-38t-38-16h-750q-23 0-38 16t-16 38v750q0 22 16 38t38 16h517q23 0 50-12t42-26l156-157q16-15 27-42t11-49z',
105+
'ascent': 850,
106+
'descent': -150
107+
}
108+
};

package.json

+4-5
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
],
2323
"scripts": {
2424
"preprocess": "node tasks/preprocess.js",
25-
"postinstall": "npm run preprocess",
2625
"bundle": "node tasks/bundle.js",
2726
"header": "node tasks/header.js",
2827
"build": "npm run preprocess && npm run bundle && npm run header",
@@ -70,14 +69,12 @@
7069
"ndarray-fill": "^1.0.1",
7170
"ndarray-homography": "^1.0.0",
7271
"ndarray-ops": "^1.2.2",
73-
"node-sass": "^3.4.1",
7472
"right-now": "^1.0.0",
7573
"robust-orientation": "^1.1.3",
7674
"sane-topojson": "^1.2.0",
7775
"superscript-text": "^1.0.0",
7876
"tinycolor2": "1.1.2",
79-
"topojson": "^1.6.19",
80-
"xml2js": "^0.4.15"
77+
"topojson": "^1.6.19"
8178
},
8279
"devDependencies": {
8380
"brfs": "^1.4.1",
@@ -94,11 +91,13 @@
9491
"karma-coverage": "^0.5.3",
9592
"karma-firefox-launcher": "^0.1.6",
9693
"karma-jasmine": "^0.3.6",
94+
"node-sass": "^3.4.1",
9795
"open": "0.0.5",
9896
"prepend-file": "^1.3.0",
9997
"prettysize": "0.0.3",
10098
"through2": "^2.0.0",
10199
"uglify-js": "^2.5.0",
102-
"watchify": "^3.6.0"
100+
"watchify": "^3.6.0",
101+
"xml2js": "^0.4.15"
103102
}
104103
}

tasks/util/pull_font_svg.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,12 @@ module.exports = function pullFontSVG(data, pathOut) {
3131
'',
3232
'\'use strict\';',
3333
'',
34-
'module.exports = ' + charStr + ';'
34+
'module.exports = ' + charStr + ';',
35+
''
3536
].join('\n');
3637

3738
fs.writeFile(pathOut, outStr, function(err) {
3839
if(err) throw err;
3940
});
4041
});
4142
};
42-

0 commit comments

Comments
 (0)