-
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: more rigorous handling of manifests, support for choosing column…
…s in download_to_depth
- Loading branch information
Showing
15 changed files
with
460 additions
and
276 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 |
---|---|---|
@@ -0,0 +1,60 @@ | ||
<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', | ||
}, | ||
}, | ||
}; | ||
|
||
let scatterplot = null; | ||
onMount(() => { | ||
scatterplot = new Scatterplot('#deepscatter'); | ||
window.scatterplot = scatterplot; | ||
scatterplot.plotAPI(prefs); | ||
}); | ||
</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> |
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,16 +1,28 @@ | ||
<script> | ||
import { onMount } from 'svelte'; | ||
import FourClasses from './FourClasses.svelte'; | ||
import SinglePoint from './SinglePoint.svelte'; | ||
const modes = { | ||
FourClasses: FourClasses, | ||
SinglePoint: SinglePoint, | ||
}; | ||
|
||
$: mode = 'SinglePoint'; | ||
$: mode = ''; | ||
onMount(() => { | ||
mode = window.location.hash.slice(1); | ||
// window.onhashchange(() => { | ||
// mode = window.location.hash.slice(1); | ||
// }); | ||
}); | ||
</script> | ||
|
||
{#if mode in modes} | ||
<svelte:component this={modes[mode]} /> | ||
{:else} | ||
<h1>Mode not found</h1> | ||
<h1>Put a load mode from the list in the hash.</h1> | ||
<div> | ||
{#each Object.keys(modes) as modename} | ||
<a href="#{modename}">{modename}</a><br /> | ||
{/each} | ||
</div> | ||
{/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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
<script> | ||
import { Table, tableFromArrays, tableFromJSON } from 'apache-arrow'; | ||
import { Scatterplot } from '../src/deepscatter'; | ||
import { onMount } from 'svelte'; | ||
|
||
const tb = tableFromArrays({ | ||
x: new Float32Array([0.001, 0.5, -0.5]), | ||
y: new Float32Array([0.001, -0.5, 0.5]), | ||
ix: new Int32Array([1, 2, 3]), | ||
}); | ||
|
||
tb.schema.metadata.set( | ||
'extent', | ||
JSON.stringify({ | ||
x: [-1.1, 1.1], | ||
y: [-1.1, 1.1], | ||
}), | ||
); | ||
|
||
const startSize = 480; | ||
|
||
const prefs = { | ||
arrow_table: tb, | ||
max_points: 1, | ||
alpha: 100, // 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: '#EEEEEE', | ||
encoding: { | ||
color: { | ||
constant: '#00FF00', | ||
}, | ||
x: { | ||
field: 'x', | ||
transform: 'literal', | ||
}, | ||
y: { | ||
field: 'y', | ||
transform: 'literal', | ||
}, | ||
}, | ||
}; | ||
|
||
let scatterplot = null; | ||
onMount(() => { | ||
scatterplot = new Scatterplot('#deepscatter', 480, 480); | ||
window.scatterplot = scatterplot; | ||
scatterplot.plotAPI(prefs); | ||
}); | ||
</script> | ||
|
||
<div id="overlay"></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> |
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
Oops, something went wrong.