forked from observablehq/plot
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
support for fillOpacity in swatch and ramp color legends (observableh…
…q#1407) * support for fillOpacity in swatch and ramp color legends closes observablehq#1356 * opacity * fill opacity it is * use fill-opacity * minimize diff * minimize diff; add default * regenerate test snapshots --------- Co-authored-by: Mike Bostock <[email protected]>
- Loading branch information
Showing
12 changed files
with
331 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<div class="plot" style=" | ||
--swatchWidth: 15px; | ||
--swatchHeight: 15px; | ||
"> | ||
<style> | ||
.plot { | ||
font-family: system-ui, sans-serif; | ||
font-size: 10px; | ||
margin-bottom: 0.5em; | ||
margin-left: 0px; | ||
} | ||
|
||
.plot-swatch svg { | ||
width: var(--swatchWidth); | ||
height: var(--swatchHeight); | ||
margin-right: 0.5em; | ||
} | ||
|
||
.plot { | ||
display: flex; | ||
align-items: center; | ||
min-height: 33px; | ||
flex-wrap: wrap; | ||
} | ||
|
||
.plot-swatch { | ||
display: inline-flex; | ||
align-items: center; | ||
margin-right: 1em; | ||
} | ||
</style><span class="plot-swatch"><svg fill="#4e79a7" fill-opacity="0.5" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> | ||
<rect width="100%" height="100%"></rect> | ||
</svg>Dream</span><span class="plot-swatch"><svg fill="#f28e2c" fill-opacity="0.5" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> | ||
<rect width="100%" height="100%"></rect> | ||
</svg>Torgersen</span><span class="plot-swatch"><svg fill="#e15759" fill-opacity="0.5" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> | ||
<rect width="100%" height="100%"></rect> | ||
</svg>Biscoe</span> | ||
</div> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
<div class="plot" style=" | ||
--swatchWidth: 15px; | ||
--swatchHeight: 15px; | ||
"> | ||
<style> | ||
.plot { | ||
font-family: system-ui, sans-serif; | ||
font-size: 10px; | ||
margin-bottom: 0.5em; | ||
margin-left: 0px; | ||
} | ||
|
||
.plot-swatch>svg { | ||
width: var(--swatchWidth); | ||
height: var(--swatchHeight); | ||
margin-right: 0.5em; | ||
overflow: visible; | ||
fill: none; | ||
fill-opacity: 1; | ||
stroke: undefined; | ||
stroke-width: 1.5px; | ||
stroke-opacity: 0.5; | ||
} | ||
|
||
.plot { | ||
display: flex; | ||
align-items: center; | ||
min-height: 33px; | ||
flex-wrap: wrap; | ||
} | ||
|
||
.plot-swatch { | ||
display: inline-flex; | ||
align-items: center; | ||
margin-right: 1em; | ||
} | ||
</style><span class="plot-swatch"><svg viewBox="-8 -8 16 16" stroke="#4e79a7" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> | ||
<path d="M4.5,0A4.5,4.5,0,1,1,-4.5,0A4.5,4.5,0,1,1,4.5,0"></path> | ||
</svg>A</span><span class="plot-swatch"><svg viewBox="-8 -8 16 16" stroke="#f28e2c" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> | ||
<path d="M-6.873,0L6.873,0M0,6.873L0,-6.873"></path> | ||
</svg>B</span><span class="plot-swatch"><svg viewBox="-8 -8 16 16" stroke="#e15759" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> | ||
<path d="M-4.87,-4.87L4.87,4.87M-4.87,4.87L4.87,-4.87"></path> | ||
</svg>C</span><span class="plot-swatch"><svg viewBox="-8 -8 16 16" stroke="#76b7b2" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> | ||
<path d="M0,-5.443L4.714,2.721L-4.714,2.721Z"></path> | ||
</svg>D</span><span class="plot-swatch"><svg viewBox="-8 -8 16 16" stroke="#59a14f" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> | ||
<path d="M0,4.769L0,-4.769M-4.13,-2.384L4.13,2.384M-4.13,2.384L4.13,-2.384"></path> | ||
</svg>E</span><span class="plot-swatch"><svg viewBox="-8 -8 16 16" stroke="#edc949" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> | ||
<path d="M3.534,3.534L3.534,-3.534L-3.534,-3.534L-3.534,3.534Z"></path> | ||
</svg>F</span> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<div class="plot" style=" | ||
--swatchWidth: 15px; | ||
--swatchHeight: 15px; | ||
"> | ||
<style> | ||
.plot { | ||
font-family: system-ui, sans-serif; | ||
font-size: 10px; | ||
margin-bottom: 0.5em; | ||
margin-left: 0px; | ||
} | ||
|
||
.plot-swatch>svg { | ||
width: var(--swatchWidth); | ||
height: var(--swatchHeight); | ||
margin-right: 0.5em; | ||
overflow: visible; | ||
fill: red; | ||
fill-opacity: 0.5; | ||
stroke: none; | ||
stroke-width: 1.5px; | ||
stroke-opacity: 1; | ||
} | ||
|
||
.plot { | ||
display: flex; | ||
align-items: center; | ||
min-height: 33px; | ||
flex-wrap: wrap; | ||
} | ||
|
||
.plot-swatch { | ||
display: inline-flex; | ||
align-items: center; | ||
margin-right: 1em; | ||
} | ||
</style><span class="plot-swatch"><svg viewBox="-8 -8 16 16" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> | ||
<path d="M4.5,0A4.5,4.5,0,1,1,-4.5,0A4.5,4.5,0,1,1,4.5,0"></path> | ||
</svg>Dream</span><span class="plot-swatch"><svg viewBox="-8 -8 16 16" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> | ||
<path d="M-5.35,-1.783L-1.783,-1.783L-1.783,-5.35L1.783,-5.35L1.783,-1.783L5.35,-1.783L5.35,1.783L1.783,1.783L1.783,5.35L-1.783,5.35L-1.783,1.783L-5.35,1.783Z"></path> | ||
</svg>Torgersen</span><span class="plot-swatch"><svg viewBox="-8 -8 16 16" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> | ||
<path d="M0,-7.423L4.285,0L0,7.423L-4.285,0Z"></path> | ||
</svg>Biscoe</span> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<div class="plot" style=" | ||
--swatchWidth: 15px; | ||
--swatchHeight: 15px; | ||
"> | ||
<style> | ||
.plot { | ||
font-family: system-ui, sans-serif; | ||
font-size: 10px; | ||
margin-bottom: 0.5em; | ||
margin-left: 0px; | ||
} | ||
|
||
.plot-swatch>svg { | ||
width: var(--swatchWidth); | ||
height: var(--swatchHeight); | ||
margin-right: 0.5em; | ||
overflow: visible; | ||
fill: none; | ||
fill-opacity: 1; | ||
stroke: red; | ||
stroke-width: 1.5px; | ||
stroke-opacity: 0.5; | ||
} | ||
|
||
.plot { | ||
display: flex; | ||
align-items: center; | ||
min-height: 33px; | ||
flex-wrap: wrap; | ||
} | ||
|
||
.plot-swatch { | ||
display: inline-flex; | ||
align-items: center; | ||
margin-right: 1em; | ||
} | ||
</style><span class="plot-swatch"><svg viewBox="-8 -8 16 16" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> | ||
<path d="M4.5,0A4.5,4.5,0,1,1,-4.5,0A4.5,4.5,0,1,1,4.5,0"></path> | ||
</svg>Dream</span><span class="plot-swatch"><svg viewBox="-8 -8 16 16" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> | ||
<path d="M-6.873,0L6.873,0M0,6.873L0,-6.873"></path> | ||
</svg>Torgersen</span><span class="plot-swatch"><svg viewBox="-8 -8 16 16" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> | ||
<path d="M-4.87,-4.87L4.87,4.87M-4.87,4.87L4.87,-4.87"></path> | ||
</svg>Biscoe</span> | ||
</div> |
Oops, something went wrong.