Skip to content

var(--plot-background) #1513

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 1 commit into from
May 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
8 changes: 2 additions & 6 deletions docs/.vitepress/theme/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,8 @@
color: var(--vp-c-text-2);
}

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

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

.vp-doc :not(pre) > code {
Expand Down
4 changes: 2 additions & 2 deletions src/marker.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,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 @@ -69,7 +69,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 @@ -22,7 +22,7 @@ export function tree(data, options = {}) {
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 @@ -219,6 +219,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/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/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/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/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/armadillo.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/aspectRatioBand.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/aspectRatioLinear.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/aspectRatioLog.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/aspectRatioPoint.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/aspectRatioSqrt.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/athletesBinsColors.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/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/athletesNationality.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
1 change: 1 addition & 0 deletions test/output/athletesSortFacet.svg
1 change: 1 addition & 0 deletions test/output/athletesSortNationality.html
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
</div><svg class="plot" fill="currentColor" font-family="system-ui, sans-serif" font-size="10" text-anchor="middle" width="640" height="400" viewBox="0 0 640 400" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<style>
.plot {
--plot-background: white;
display: block;
height: auto;
height: intrinsic;
Expand Down
1 change: 1 addition & 0 deletions test/output/athletesSortNullLimit.html
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
</div><svg class="plot" fill="currentColor" font-family="system-ui, sans-serif" font-size="10" text-anchor="middle" width="640" height="400" viewBox="0 0 640 400" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<style>
.plot {
--plot-background: white;
display: block;
height: auto;
height: intrinsic;
Expand Down
1 change: 1 addition & 0 deletions test/output/athletesSortWeightLimit.svg
1 change: 1 addition & 0 deletions test/output/athletesSportSex.svg
1 change: 1 addition & 0 deletions test/output/athletesSportWeight.svg
1 change: 1 addition & 0 deletions test/output/athletesWeight.svg
Loading