|
9 | 9 | faImage,
|
10 | 10 | faLink,
|
11 | 11 | faPaintBrush,
|
| 12 | + faQuestion, |
12 | 13 | faReceipt,
|
13 | 14 | faSearchPlus,
|
| 15 | + faUpDown, |
14 | 16 | } from '@fortawesome/free-solid-svg-icons';
|
15 | 17 | import Fa from 'svelte-fa';
|
16 |
| - import { activeDatasets, isShowingPoints, navMode, randomizeColors, reset, scaleMean } from '../store'; |
| 18 | + import { activeDatasets, isShowingPoints, navMode, randomizeColors, reset, scaleMean, autoFit } from '../store'; |
17 | 19 | import type { IChart } from '../store';
|
18 | 20 | import { NavMode } from './chartUtils';
|
| 21 | + import { tour } from '../tour'; |
19 | 22 | import RegressionDialog from './dialogs/RegressionDialog.svelte';
|
20 | 23 | import DirectLinkDialog from './dialogs/DirectLinkDialog.svelte';
|
21 | 24 |
|
|
67 | 70 | case 's':
|
68 | 71 | $isShowingPoints = !$isShowingPoints;
|
69 | 72 | break;
|
| 73 | + case 'a': |
| 74 | + $autoFit = !$autoFit; |
| 75 | + break; |
| 76 | + case 'h': |
| 77 | + tour.cancel(); |
| 78 | + tour.start(); |
| 79 | + break; |
70 | 80 | }
|
71 | 81 | }
|
72 | 82 | </script>
|
|
92 | 102 | >
|
93 | 103 | <button
|
94 | 104 | type="button"
|
95 |
| - class="uk-button uk-button-default uk-button-small" |
| 105 | + class="uk-button uk-button-small" |
| 106 | + disabled={!chart} |
| 107 | + class:uk-active={$autoFit} |
| 108 | + class:uk-button-secondary={$autoFit} |
| 109 | + class:uk-button-default={!$autoFit} |
| 110 | + on:click|preventDefault={() => ($autoFit = !$autoFit)} |
| 111 | + title="Automatically Fit Data<br/>(Keyboard Shortcut: a)" |
| 112 | + data-tour="autofit" |
| 113 | + uk-tooltip><Fa icon={faUpDown} /></button |
| 114 | + > |
| 115 | + <button |
| 116 | + type="button" |
| 117 | + class="uk-button uk-button-small" |
96 | 118 | class:uk-active={$isShowingPoints}
|
| 119 | + class:uk-button-secondary={$isShowingPoints} |
| 120 | + class:uk-button-default={!$isShowingPoints} |
97 | 121 | on:click|preventDefault={() => ($isShowingPoints = !$isShowingPoints)}
|
98 | 122 | title="Show or Hide points<br/>(Keyboard Shortcut: s)"
|
99 | 123 | data-tour="points"
|
|
111 | 135 | class="uk-button uk-button-default uk-button-small"
|
112 | 136 | on:click|preventDefault={() => (doDialog = 'regress')}
|
113 | 137 | title="Perform Regression"
|
114 |
| - uk-tootlip |
| 138 | + uk-tooltip |
115 | 139 | disabled={$activeDatasets.length < 2}><Fa icon={faChartLine} /></button
|
116 | 140 | >
|
117 | 141 | <button
|
|
145 | 169 | <div class="uk-button-group" data-tour="navmode">
|
146 | 170 | <button
|
147 | 171 | type="button"
|
148 |
| - class="uk-button uk-button-default uk-button-small" |
| 172 | + class="uk-button uk-button-small" |
149 | 173 | class:uk-active={$navMode === NavMode.pan}
|
150 | 174 | title="Pan Mode<br/>(Keyboard Shortcut: p)"
|
| 175 | + class:uk-button-secondary={$navMode === NavMode.pan} |
| 176 | + class:uk-button-default={$navMode !== NavMode.pan} |
151 | 177 | uk-tooltip
|
152 | 178 | on:click|preventDefault={() => ($navMode = NavMode.pan)}><Fa icon={faArrowsAlt} /></button
|
153 | 179 | >
|
154 | 180 | <button
|
155 | 181 | type="button"
|
156 |
| - class="uk-button uk-button-default uk-button-small" |
| 182 | + class="uk-button uk-button-small" |
157 | 183 | class:uk-active={$navMode === NavMode.crop}
|
| 184 | + class:uk-button-secondary={$navMode === NavMode.crop} |
| 185 | + class:uk-button-default={$navMode !== NavMode.crop} |
158 | 186 | title="Crop Mode<br/>(Keyboard Shortcut: c)"
|
159 | 187 | uk-tooltip
|
160 | 188 | on:click|preventDefault={() => ($navMode = NavMode.crop)}><Fa icon={faCrop} /></button
|
161 | 189 | >
|
162 | 190 | <button
|
163 | 191 | type="button"
|
164 |
| - class="uk-button uk-button-default uk-button-small" |
| 192 | + class="uk-button uk-button-small" |
165 | 193 | class:uk-active={$navMode === NavMode.zoom}
|
| 194 | + class:uk-button-secondary={$navMode === NavMode.zoom} |
| 195 | + class:uk-button-default={$navMode !== NavMode.zoom} |
166 | 196 | title="Zoom Mode<br/>(Keyboard Shortcut: z)"
|
167 | 197 | uk-tooltip
|
168 | 198 | on:click|preventDefault={() => ($navMode = NavMode.zoom)}><Fa icon={faSearchPlus} /></button
|
169 | 199 | >
|
170 | 200 | </div>
|
| 201 | + <div class="uk-button-group"> |
| 202 | + <button |
| 203 | + type="button" |
| 204 | + class="uk-button uk-button-default uk-button-small" |
| 205 | + disabled={!chart} |
| 206 | + title="View introductory tour<br/>(Keyboard Shortcut: h)" |
| 207 | + uk-tooltip |
| 208 | + data-tour="datatour" |
| 209 | + on:click|preventDefault={() => { |
| 210 | + tour.cancel(); |
| 211 | + tour.start(); |
| 212 | + }}><Fa icon={faQuestion} /></button |
| 213 | + > |
| 214 | + </div> |
171 | 215 | </div>
|
172 | 216 |
|
173 | 217 | {#if doDialog === 'regress'}
|
|
0 commit comments