Skip to content

Commit

Permalink
var(--plot-background) (#1513)
Browse files Browse the repository at this point in the history
  • Loading branch information
mbostock committed Oct 27, 2023
1 parent 5638a17 commit dbfadd9
Show file tree
Hide file tree
Showing 600 changed files with 715 additions and 61 deletions.
15 changes: 1 addition & 14 deletions docs/.vitepress/theme/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@

.vp-doc .plot,
.vp-doc .plot-ramp {
--plot-background: var(--vp-c-bg); /* TODO -alt for tip? */
overflow: visible;
position: relative;
z-index: 1;
Expand Down Expand Up @@ -70,20 +71,6 @@
text-decoration: initial;
}

:root [aria-label="tip"][fill="white"],
:root [aria-label="tip"] [fill="white"] {
fill: var(--vp-c-bg-alt);
}

:root.dark marker[stroke="white"],
:root.dark [aria-label^="crosshair"][stroke="white"] {
stroke: var(--vp-c-bg);
}

:root.dark marker[fill="white"] {
fill: var(--vp-c-bg);
}

.vp-doc :not(pre) > code {
line-height: 1.5;
}
Expand Down
4 changes: 2 additions & 2 deletions src/marker.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ function markerCircleFill(color, context) {
.attr("markerWidth", 6.67)
.attr("markerHeight", 6.67)
.attr("fill", color)
.attr("stroke", "white")
.attr("stroke", "var(--plot-background)")
.attr("stroke-width", 1.5)
.call((marker) => marker.append("circle").attr("r", 3))
.node();
Expand All @@ -72,7 +72,7 @@ function markerCircleStroke(color, context) {
.attr("viewBox", "-5 -5 10 10")
.attr("markerWidth", 6.67)
.attr("markerHeight", 6.67)
.attr("fill", "white")
.attr("fill", "var(--plot-background)")
.attr("stroke", color)
.attr("stroke-width", 1.5)
.call((marker) => marker.append("circle").attr("r", 3))
Expand Down
2 changes: 1 addition & 1 deletion src/marks/tree.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export function tree(
markerEnd = marker,
dot: dotDot = isNoneish(markerStart) && isNoneish(markerEnd),
text: textText = "node:name",
textStroke = "white",
textStroke = "var(--plot-background)",
title = "node:path",
dx,
dy,
Expand Down
1 change: 1 addition & 0 deletions src/plot.js
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,7 @@ export function plot(options = {}) {
// Warning: if you edit this, change defaultClassName.
svg.append("style").text(
`.${className} {
--plot-background: white;
display: block;
height: auto;
height: intrinsic;
Expand Down
1 change: 1 addition & 0 deletions test/output/aaplBollinger.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions test/output/aaplBollingerCandlestick.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions test/output/aaplBollingerGridInterval.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions test/output/aaplBollingerGridSpacing.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions test/output/aaplCandlestick.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions test/output/aaplChangeVolume.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions test/output/aaplClose.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions test/output/aaplCloseClip.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions test/output/aaplCloseDataTicks.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions test/output/aaplCloseGridColor.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions test/output/aaplCloseGridInterval.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions test/output/aaplCloseGridIntervalName.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions test/output/aaplCloseGridIterable.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions test/output/aaplCloseImplicitGrid.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions test/output/aaplCloseNormalize.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions test/output/aaplCloseUntyped.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions test/output/aaplFancyAxis.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions test/output/aaplInterval.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions test/output/aaplMonthly.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions test/output/aaplVolume.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions test/output/aaplVolumeRect.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions test/output/anscombeQuartet.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions test/output/arcCollatz.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions test/output/arcCollatzUp.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions test/output/arcMiserables.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions test/output/armadillo.svg
1 change: 1 addition & 0 deletions test/output/aspectRatioBand.svg
1 change: 1 addition & 0 deletions test/output/aspectRatioLinear.svg
1 change: 1 addition & 0 deletions test/output/aspectRatioLog.svg
1 change: 1 addition & 0 deletions test/output/aspectRatioPoint.svg
1 change: 1 addition & 0 deletions test/output/aspectRatioSqrt.svg
1 change: 1 addition & 0 deletions test/output/athletesBinsColors.svg
1 change: 1 addition & 0 deletions test/output/athletesBirthdays.svg
1 change: 1 addition & 0 deletions test/output/athletesBoxingHeight.svg
1 change: 1 addition & 0 deletions test/output/athletesHeightWeight.svg
1 change: 1 addition & 0 deletions test/output/athletesHeightWeightBin.svg
1 change: 1 addition & 0 deletions test/output/athletesHeightWeightBinStroke.svg
1 change: 1 addition & 0 deletions test/output/athletesHeightWeightSex.svg
1 change: 1 addition & 0 deletions test/output/athletesHeightWeightSport.svg
1 change: 1 addition & 0 deletions test/output/athletesSample.svg
1 change: 1 addition & 0 deletions test/output/athletesSampleFacet.svg
1 change: 1 addition & 0 deletions test/output/athletesSexWeight.svg
Loading

0 comments on commit dbfadd9

Please sign in to comment.