Debian Codegraph @

js/less/bqplot.less

raw
1 /* Copyright 2015 Bloomberg Finance L.P.
2 *
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 * http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
16 :root {
17 --bq-content-font-color: var(--jp-content-font-color1);
18 --bq-content-scatter-font-color: var(--jp-content-font-color1);
19 --bq-background: var(--jp-layout-color0);
20 --bq-font: 12px sans-serif;
21
22 --bq-axislabel-font: 14px sans-serif;
23
24 --bq-axis-rect-opacity: 1;
25 --bq-axis-tick-stroke-width: 1;
26 --bq-axis-tick-opacity: 1;
27 --bq-axis-tick-text-font: var(--bq-font);
28
29 --bq-mark-tooltip-border-radius: 5px;
30 --bq-mark-tooltip--webkit-user-select: none;
31 --bq-mark-tooltip--moz-user-select: none;
32
33 --bq-mainheading-font: 16px sans-serif;
34 --bq-mainheading-font-size: large;
35
36 --bq-world-map-path-stroke-width: 0.25px;
37
38 --bq-pie-polyline-stroke-width: 1px;
39 --bq-pie-polyline-fill: none;
40
41 --bq-network-node-element-stroke: #000;
42 --bq-network-node-element-stroke-width: 1.5px;
43
44 --bq-network-link-fill: none;
45 --bq-network-link-stroke: #666;
46 --bq-network-link-stroke-width: 1.5px;
47
48 --bq-network-node-label-pointer-events: none;
49 --bq-network-node-label-font: var(--bq-font);
50
51 --bq-selector-fill: var(--jp-border-color1);
52
53 --bq-mark-tooltip-border: 2px solid var(--jp-border-color0);
54 --bq-mark-tooltip-box-shadow: 0px 3px 5px -1px rgba(0, 0, 0, 0.2),
55 0px 6px 10px 0px rgba(0, 0, 0, 0.14), 0px 1px 18px 0px rgba(0, 0, 0, 0.12);
56 --bq-mark-tooltip-background-color: var(--jp-layout-color0);
57 --bq-mark-tooltip-td-border: 1px solid var(--jp-border-color1);
58
59 --bq-world-map-path-stroke: black;
60 --bq-world-map-path-fill: seagreen;
61
62 --bq-pie-polyline-opacity: 0.3;
63 --bq-pie-polyline-stroke: var(--bq-content-font-color);
64
65 --bq-network-node-element-fill: #666;
66 --bq-linkarrow-fill-dark: rgb(0, 0, 0);
67 --bq-linkarrow-fill-light: #666;
68
69 --bq-default-stroke: var(--bq-content-font-color);
70 --bq-stick-stroke: var(--bq-content-font-color);
71 --bq-stick-fill: var(--bq-content-font-color);
72 --bq-sticktext-fill: var(--bq-content-font-color);
73 }
74
75 /*
76 * gg and classic bqplot themes differ in the styling of the svg-background.
77 *
78 * plot area background fill:
79 * - gg: contrasted with the jupyterlab background. var(--jp-layout-color2);
80 * - classic: less contrasted: var(--jp-layout-color1);
81 *
82 * tick text fill:
83 * - gg: less contrasted with background: var(--jp-content-font-color2);
84 * - classic: more contrasted with background: var(--jp-content-font-color1);
85 *
86 * grid, axes, and tick colors:
87 * - gg: grid, axes, and tick marks are all of the same (grid) color
88 * - classic: grid has little contrast with respect to the background while the axes,
89 * and tick marks are more contrasted.
90 */
91
92 .common() {
93 --bq-mainheading-fill: var(--bq-content-font-color);
94 --bq-axislabel-fill: var(--bq-content-font-color);
95 }
96
97 .gg {
98 --bq-plotarea-background-fill: var(--jp-layout-color2);
99 --bq-axis-tick-text-fill: var(--jp-content-font-color2);
100
101 --bq-grid-color: var(--jp-layout-color0);
102 --bq-axis-rect-stroke: var(--bq-grid-color);
103 --bq-axis-path-stroke: var(--bq-grid-color);
104 --bq-axis-tick-stroke: var(--bq-grid-color);
105 --bq-axis-tick-short-stroke: var(--bq-grid-color);
106
107 .common();
108 }
109
110 [data-jp-theme-light='false'] .gg {
111 --bq-plotarea-background-fill: var(--jp-layout-color1);
112 }
113
114 [data-jp-theme-light='false'] .linkarrow {
115 fill: var(--bq-linkarrow-fill-light);
116 }
117
118 .classic {
119 --bq-plotarea-background-fill: var(--jp-layout-color0);
120 --bq-axis-tick-text-fill: var(--jp-content-font-color2);
121
122 --bq-grid-color: var(--jp-layout-color2);
123 --bq-axis-border-color: var(--jp-content-font-color2);
124 --bq-axis-path-stroke: var(--bq-axis-border-color);
125 --bq-axis-rect-stroke: var(--bq-axis-border-color);
126 --bq-axis-tick-stroke: var(--bq-grid-color);
127 --bq-axis-tick-short-stroke: var(--bq-axis-border-color);
128
129 .common();
130 }
131
132 .bbg,
133 [data-jp-theme-light='false'] {
134 --bq-content-font-color: orange;
135
136 .common();
137 }
138
139 .bqplot {
140 box-sizing: border-box;
141 display: flex;
142 width: auto;
143 height: 480px;
144 }
145 .bqplot > .svg-background {
146 position: absolute;
147 width: 100%;
148 height: 100%;
149 z-index: 0;
150 }
151 .bqplot > canvas {
152 position: absolute;
153 pointer-events: none;
154 z-index: 0;
155 }
156 .bqplot > svg {
157 z-index: 0;
158 font: 11px sans-serif;
159 user-select: none;
160 -ms-user-select: none;
161 -khtml-user-select: none;
162 -khtml-user-select: none;
163 -webkit-user-select: none;
164 flex-grow: 1;
165
166 .svg-figure {
167 background: var(--bq-background);
168 }
169
170 .axis {
171 rect {
172 stroke: var(--bq-axis-rect-stroke);
173 opacity: var(--bq-axis-rect-opacity);
174 }
175 .tick line {
176 stroke: var(--bq-axis-tick-stroke);
177 stroke-width: var(--bq-axis-tick-stroke-width);
178 opacity: var(--bq-axis-tick-opacity);
179 }
180 .tick.short line {
181 stroke: var(--bq-axis-tick-short-stroke);
182 }
183 .tick text {
184 fill: var(--bq-axis-tick-text-fill);
185 font: var(--bq-axis-tick-text-font);
186 }
187 line {
188 shape-rendering: crispEdges;
189 font: 10px sans-serif;
190 stroke-width: 1px;
191 }
192 path,
193 line {
194 fill: none;
195 }
196 path {
197 stroke: var(--bq-axis-path-stroke);
198 }
199
200 text.axislabel,
201 tspan.axislabel {
202 text-anchor: end;
203 fill: var(--bq-axislabel-fill);
204 font: var(--bq-axislabel-font);
205 }
206 .tick text {
207 cursor: default;
208 }
209 }
210 .axis.axisbold path {
211 stroke-width: 3px;
212 }
213 .axis.axisbold text,
214 .axis.axisbold text.axislabel {
215 font-weight: bolder;
216 }
217 .stick,
218 .zeroLine {
219 stroke: var(--bq-stick-stroke);
220 fill: var(--bq-stick-fill);
221 }
222 .sticktext {
223 fill: var(--bq-sticktext-fill);
224 }
225 .bargroup,
226 .boxplot,
227 .slice {
228 rect,
229 path,
230 line {
231 stroke: var(--bq-default-stroke);
232 }
233 }
234 .zeroLine {
235 shape-rendering: crispEdges;
236 }
237 text.mainheading {
238 text-anchor: middle;
239 fill: var(--bq-mainheading-fill);
240 font: var(--bq-mainheading-font);
241 font-size: var(--bq-mainheading-font-size);
242 }
243 text.legendtext {
244 text-anchor: start;
245 font: 14px sans-serif;
246 }
247 text.dot_text {
248 fill: var(--bq-content-scatter-font-color);
249 }
250 .indsel {
251 stroke: red;
252 }
253 .brushintsel {
254 text {
255 fill: var(--bq-content-font-color);
256 font: var(--bq-font);
257 text-anchor: middle;
258 }
259 .selection {
260 fill: var(--bq-selector-fill);
261 stroke: none;
262 }
263 }
264 .intsel {
265 fill: var(--bq-selector-fill);
266 stroke: none;
267 fill-opacity: 0.3;
268 }
269 .intselmouse {
270 visibility: hidden;
271 pointer-events: all; /*none?*/
272 }
273 .multiselector {
274 .active {
275 pointer-events: all;
276 .selection {
277 stroke: green;
278 }
279 .overlay {
280 pointer-events: all;
281 }
282 }
283 .inactive {
284 pointer-events: none;
285 .selection {
286 stroke: red;
287 }
288 .overlay {
289 pointer-events: none;
290 }
291 }
292 .visible {
293 pointer-events: all;
294 .selection {
295 stroke: red;
296 }
297 .overlay {
298 pointer-events: none;
299 }
300 }
301 }
302 .lassoselector {
303 .selected {
304 opacity: 0.3;
305 }
306 path {
307 fill: none;
308 stroke: orange;
309 stroke-width: 4;
310 }
311 }
312 .plotarea_background {
313 fill: var(--bq-plotarea-background-fill);
314 }
315 .plotarea_events {
316 opacity: 0; // fully transparent, only used for capturing events
317 }
318 .image_pixelated {
319 /*
320 optimizespeed does not guarantee nearest neighbor, but firefox seems to do so for now
321 https://www.w3.org/TR/SVG/single-page.html#painting-ImageRenderingProperty
322 */
323 image-rendering: optimizespeed;
324 image-rendering: pixelated; /* chrome doesn't support optimizespeed */
325 image-rendering: -moz-crisp-edges; /* this is guaranteed to work for firefox */
326 }
327 }
328 .tooltip_div {
329 z-index: 1001;
330 }
331 .mark_tooltip {
332 pointer-events: none;
333 z-index: 1001;
334 color: var(--bq-content-font-color);
335 font: var(--bq-font);
336 border: var(--jp-border-width) solid var(--jp-border-color1);
337 box-shadow: var(--bq-mark-tooltip-box-shadow);
338 background-color: var(--bq-mark-tooltip-background-color);
339 -webkit-user-select: var(--bq-mark-tooltip--webkit-user-select);
340 -moz-user-select: var(--bq-mark-tooltip--moz-user-select);
341 }
342 .mark_tooltip > .bqplot.figure {
343 width: 427px;
344 height: 320px;
345 }
346 .mark_tooltip .tooltiptext {
347 text-align: center;
348 padding: 0.5em;
349 }
350 .world_map path {
351 stroke: var(--bq-world-map-path-stroke);
352 stroke-width: var(--bq-world-map-path-stroke-width);
353 fill: var(--bq-world-map-path-fill);
354 }
355 .world_map .hovered {
356 fill: Orange;
357 stroke: Orange;
358 stroke-width: 2.5px;
359 }
360
361 .world_map #container {
362 margin: 10px 10%;
363 border: 2px solid #000;
364 border-radius: 5px;
365 height: 100%;
366 overflow: hidden;
367 background: #f0f8ff;
368 }
369
370 .world_map .graticule {
371 fill: none;
372 stroke: #bbb;
373 stroke-width: 0.5px;
374 stroke-opacity: 0.5;
375 }
376
377 .g_legend {
378 fill: none;
379 }
380
381 .pie polyline {
382 opacity: var(--bq-pie-polyline-opacity);
383 stroke: var(--bq-pie-polyline-stroke);
384 stroke-width: var(--bq-pie-polyline-stroke-width);
385 fill: var(--bq-pie-polyline-fill);
386 }
387
388 .pie_label {
389 fill: var(--bq-content-font-color);
390 }
391
392 .bar_label {
393 fill: var(--bq-content-font-color);
394 }
395
396 .network .node .element {
397 fill: var(--bq-network-node-element-fill);
398 stroke: var(--bq-network-node-element-stroke);
399 stroke-width: var(--bq-network-node-element-stroke-width);
400 }
401
402 .network .link {
403 fill: var(--bq-network-link-fill);
404 stroke: var(--bq-network-link-stroke);
405 stroke-width: var(--bq-network-link-stroke-width);
406 }
407
408 .network .node .label {
409 font: var(--bq-network-node-label-font);
410 pointer-events: var(--bq-network-node-label-pointer-events);
411 text-shadow: var(--bq-network-node-label-text-shadow);
412 }
413
414 .linkarrow {
415 fill: var(--bq-linkarrow-fill-dark);
416 }