-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: add test page for point size alpha variables, allow plotting one…
… point.
- Loading branch information
Showing
6 changed files
with
36 additions
and
72 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,60 +1,16 @@ | ||
<script> | ||
import { Scatterplot } from '../src/deepscatter'; | ||
import { onMount } from 'svelte'; | ||
import SwitchPositions from './svelte/SwitchPositions.svelte'; | ||
import ColorChange from './svelte/ColorChange.svelte'; | ||
import SizeSlider from './svelte/SizeSlider.svelte'; | ||
const startSize = 2; | ||
const prefs = { | ||
source_url: '/tiles', | ||
max_points: 1000000, | ||
alpha: 35, // Target saturation for the full page. | ||
zoom_balance: 0.22, // Rate at which points increase size. https://observablehq.com/@bmschmidt/zoom-strategies-for-huge-scatterplots-with-three-js | ||
point_size: startSize, // Default point size before application of size scaling | ||
background_color: '#EEEDDE', | ||
encoding: { | ||
color: { | ||
field: 'class', | ||
range: 'category10', | ||
}, | ||
x: { | ||
field: 'x', | ||
transform: 'literal', | ||
}, | ||
y: { | ||
field: 'y', | ||
transform: 'literal', | ||
}, | ||
}, | ||
import FourClasses from './FourClasses.svelte'; | ||
import SinglePoint from './SinglePoint.svelte'; | ||
const modes = { | ||
FourClasses: FourClasses, | ||
SinglePoint: SinglePoint, | ||
}; | ||
let scatterplot = null; | ||
onMount(() => { | ||
scatterplot = new Scatterplot('#deepscatter'); | ||
window.scatterplot = scatterplot; | ||
scatterplot.plotAPI(prefs); | ||
}); | ||
$: mode = 'SinglePoint'; | ||
</script> | ||
|
||
<div id="overlay"> | ||
<SwitchPositions {scatterplot}></SwitchPositions> | ||
<ColorChange {scatterplot}></ColorChange> | ||
<SizeSlider size={startSize} {scatterplot}></SizeSlider> | ||
</div> | ||
|
||
<div id="deepscatter"></div> | ||
|
||
<style> | ||
#overlay { | ||
position: fixed; | ||
z-index: 10; | ||
left: 40px; | ||
top: 40px; | ||
} | ||
#deepscatter { | ||
z-index: 0; | ||
width: 100vw; | ||
height: 100vh; | ||
} | ||
</style> | ||
{#if mode in modes} | ||
<svelte:component this={modes[mode]} /> | ||
{:else} | ||
<h1>Mode not found</h1> | ||
{/if} |
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