Skip to content

Commit 6dce38b

Browse files
committed
feat: use shepherd.js for intro tour
1 parent 2d14030 commit 6dce38b

File tree

10 files changed

+256
-6
lines changed

10 files changed

+256
-6
lines changed

package-lock.json

Lines changed: 23 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
"rollup-plugin-svelte": "^7.1.0",
5151
"rollup-plugin-terser": "^7.0.2",
5252
"sass": "^1.32.13",
53+
"shepherd.js": "^8.3.1",
5354
"sirv-cli": "^1.0.11",
5455
"svelte": "^3.38.2",
5556
"svelte-check": "^1.5.4",

src/App.svelte

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,15 @@
44
import TopMenu from './components/TopMenu.svelte';
55
import { activeDatasets, initialViewport, isShowingPoints, navMode } from './store';
66
import type { IChart } from './store';
7+
import { onMount } from 'svelte';
8+
import { tour } from './tour';
79
810
let chart: Chart | null = null;
911
$: ichart = chart as unknown as IChart | null;
12+
13+
onMount(() => {
14+
tour.start();
15+
});
1016
</script>
1117

1218
<TopMenu chart={ichart} style="grid-area: menu" />

src/components/Chart.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -771,7 +771,7 @@
771771
});
772772
</script>
773773

774-
<div {style} class="wrapper {className || ''}" bind:clientWidth={width} bind:clientHeight={height}>
774+
<div {style} class="wrapper {className || ''}" bind:clientWidth={width} bind:clientHeight={height} data-tour="chart">
775775
<canvas
776776
bind:this={canvas}
777777
{style}

src/components/ImportDataSetsMenu.svelte

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,27 +24,31 @@
2424
type="button"
2525
class="uk-button uk-button-default uk-button-small"
2626
title="Import dataset from a local CSV File"
27+
data-tour="csv"
2728
uk-tooltip
2829
on:click|preventDefault={() => (doDialog = 'csv')}><Fa icon={faFolderOpen} /></button
2930
>
3031
<button
3132
type="button"
3233
class="uk-button uk-button-default uk-button-small"
3334
title="Import dataset from Delphi API"
35+
data-tour="api"
3436
uk-tooltip
3537
on:click|preventDefault={() => (doDialog = 'api')}><Fa icon={faDatabase} /></button
3638
>
3739
<button
3840
type="button"
3941
class="uk-button uk-button-default uk-button-small"
4042
title="Add a line manually"
43+
data-tour="manually"
4144
uk-tooltip
4245
on:click|preventDefault={() => (doDialog = 'addLine')}><Fa icon={faPencilAlt} /></button
4346
>
4447
<button
4548
type="button"
4649
class="uk-button uk-button-default uk-button-small"
4750
title="Create dataset via kernel function"
51+
data-tour="kernel"
4852
uk-tooltip
4953
on:click|preventDefault={() => (doDialog = 'addKernel')}><Fa icon={faCode} /></button
5054
>

src/components/LeftMenu.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
export let style = '';
99
</script>
1010

11-
<side class="left" {style}>
11+
<side class="left" {style} data-tour="browser">
1212
<ImportDataSetsMenu />
1313
<div class="tree">
1414
{#each $datasetTree.datasets as child (child.title)}

src/components/TopMenu.svelte

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,14 @@
4343
}
4444
</script>
4545

46-
<div class="menu" {style}>
46+
<div class="menu" {style} data-tour="top">
4747
<div class="uk-button-group">
4848
<button
4949
type="button"
5050
class="uk-button uk-button-default uk-button-small"
5151
on:click|preventDefault={randomizeColors}
5252
title="Randomize Colors"
53+
data-tour="random"
5354
uk-tooltip><Fa icon={faPaintBrush} /></button
5455
>
5556
<button
@@ -58,6 +59,7 @@
5859
disabled={!chart}
5960
on:click|preventDefault={() => (chart ? chart.fitData(true) : null)}
6061
title="Fit data to screen"
62+
data-tour="fit"
6163
uk-tooltip><Fa icon={faExpand} /></button
6264
>
6365
<button
@@ -66,6 +68,7 @@
6668
class:uk-active={$isShowingPoints}
6769
on:click|preventDefault={() => ($isShowingPoints = !$isShowingPoints)}
6870
title="Show or Hide points"
71+
data-tour="points"
6972
uk-tooltip><Fa icon={faEllipsisH} /></button
7073
>
7174
<button
@@ -98,6 +101,7 @@
98101
disabled={!chart}
99102
title="Take a screenshot"
100103
uk-tooltip
104+
data-tour="screenshot"
101105
on:click|preventDefault={takeScreenshot}><Fa icon={faImage} /></button
102106
>
103107
<button
@@ -106,10 +110,11 @@
106110
title="Link to this view"
107111
disabled={!chart}
108112
uk-tooltip
113+
data-tour="link"
109114
on:click|preventDefault={() => (doDialog = 'directLink')}><Fa icon={faLink} /></button
110115
>
111116
</div>
112-
<div class="uk-button-group">
117+
<div class="uk-button-group" data-tour="navmode">
113118
<button
114119
type="button"
115120
class="uk-button uk-button-default uk-button-small"

src/components/tree/TreeLeafNode.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import type DataSet from '../../data/DataSet';
33
import { activeDatasets } from '../../store';
44
import Fa from 'svelte-fa';
5-
import { faCheckSquare, faSquare } from '@fortawesome/free-solid-svg-icons';
5+
import { faEyeSlash, faEye } from '@fortawesome/free-solid-svg-icons';
66
77
export let node: DataSet;
88
@@ -18,7 +18,7 @@
1818
</script>
1919

2020
<div class="tv_node" class:selected on:click={toggleSelected}>
21-
<Fa icon={selected ? faCheckSquare : faSquare} {color} />
21+
<Fa icon={selected ? faEye : faEyeSlash} {color} style="width: 1em" />
2222
{node.title}
2323
</div>
2424

src/global.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,7 @@
66
grid-template-columns: auto 1fr;
77
grid-template-rows: auto 1fr;
88
}
9+
10+
.shepherd-epivis-tour {
11+
line-height: 1.5rem;
12+
}

0 commit comments

Comments
 (0)