Skip to content

Commit

Permalink
Merge pull request #118 from nomic-ai/restoreLinearColorscales
Browse files Browse the repository at this point in the history
Restore linear colorscales
  • Loading branch information
bmschmidt authored Jun 13, 2024
2 parents d429fc6 + 119fc55 commit 7539e82
Show file tree
Hide file tree
Showing 5 changed files with 174 additions and 159 deletions.
16 changes: 15 additions & 1 deletion dev/svelte/ColorChange.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
export let scatterplot;
let value = 'category10';
const schemes = ['okabe', 'category10', 'dark2', 'pastel2'];
const schemes = ['okabe', 'category10', 'dark2', 'pastel2', 'observable10'];
function changeColor() {
scatterplot.plotAPI({
encoding: {
Expand All @@ -15,10 +15,24 @@
},
});
}
function plotViridis() {
scatterplot.plotAPI({
encoding: {
color: {
field: 'x',
range: 'viridis',
// range: ["red", "yellow", "pink", "purple"],
// domain: ["Apple", "Banana", "Strawberry", "Mulberry"]
},
},
});
}
</script>

<select bind:value on:change={changeColor}>
{#each schemes as scheme}
<option value={scheme}>{scheme}</option>
{/each}
</select>

<button on:click={plotViridis}>ViridisLinear</button>
38 changes: 23 additions & 15 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,11 @@
"d3-interpolate": "^3.0.1",
"d3-random": "^3.0.1",
"d3-scale": "^4.0.2",
"d3-scale-chromatic": "^3.0.0",
"d3-scale-chromatic": "^3.1.0",
"d3-selection": "^3.0.0",
"d3-timer": "^3.0.1",
"d3-transition": "^3.0.1",
"d3-zoom": "^3.0.0",
"deepscatter": "^3.0.0-next.6",
"glsl-easings": "^1.0.0",
"glsl-fast-gaussian-blur": "^1.0.2",
"glsl-read-float": "^1.1.0",
Expand Down
Loading

0 comments on commit 7539e82

Please sign in to comment.