|
10 | 10 | faLink, |
11 | 11 | faPaintBrush, |
12 | 12 | faQuestion, |
13 | | - faReceipt, |
14 | 13 | faSearchPlus, |
15 | | - faUpDown, |
| 14 | + faShuffle, |
16 | 15 | } from '@fortawesome/free-solid-svg-icons'; |
17 | 16 | import Fa from 'svelte-fa'; |
18 | | - import { activeDatasets, isShowingPoints, navMode, randomizeColors, reset, scaleMean, autoFit } from '../store'; |
| 17 | + import { activeDatasets, isShowingPoints, navMode, randomizeColors, reset, scaleMean } from '../store'; |
19 | 18 | import type { IChart } from '../store'; |
20 | 19 | import { NavMode } from './chartUtils'; |
21 | 20 | import { tour } from '../tour'; |
|
50 | 49 | return; |
51 | 50 | } |
52 | 51 | switch (e.key) { |
53 | | - case 'f': |
54 | | - if (chart) { |
55 | | - chart.fitData(true); |
56 | | - } |
| 52 | + case 'a': |
| 53 | + $navMode = NavMode.autofit; |
57 | 54 | break; |
58 | 55 | case 'p': |
59 | 56 | $navMode = NavMode.pan; |
|
70 | 67 | case 's': |
71 | 68 | $isShowingPoints = !$isShowingPoints; |
72 | 69 | break; |
73 | | - case 'a': |
74 | | - $autoFit = !$autoFit; |
75 | | - break; |
76 | 70 | case 'h': |
77 | 71 | tour.cancel(); |
78 | 72 | tour.start(); |
|
82 | 76 | </script> |
83 | 77 |
|
84 | 78 | <div class="menu" {style} data-tour="top"> |
85 | | - <div class="uk-button-group"> |
| 79 | + <div class="uk-button-group" data-tour="navmode"> |
86 | 80 | <button |
87 | 81 | type="button" |
88 | | - class="uk-button uk-button-default uk-button-small" |
89 | | - on:click|preventDefault={randomizeColors} |
90 | | - title="Randomize Colors<br/>(Keyboard Shortcut: r)" |
91 | | - data-tour="random" |
92 | | - uk-tooltip><Fa icon={faPaintBrush} /></button |
| 82 | + class="uk-button uk-button-small" |
| 83 | + disabled={!chart} |
| 84 | + class:uk-active={$navMode === NavMode.autofit} |
| 85 | + class:uk-button-secondary={$navMode === NavMode.autofit} |
| 86 | + class:uk-button-default={$navMode !== NavMode.autofit} |
| 87 | + on:click|preventDefault={() => ($navMode = NavMode.autofit)} |
| 88 | + title="Autofit Mode<br/>(Keyboard Shortcut: a)" |
| 89 | + uk-tooltip><Fa icon={faExpand} /></button |
93 | 90 | > |
94 | 91 | <button |
95 | 92 | type="button" |
96 | | - class="uk-button uk-button-default uk-button-small" |
97 | | - disabled={!chart} |
98 | | - on:click|preventDefault={() => (chart ? chart.fitData(true) : null)} |
99 | | - title="Fit Data to Screen<br/>(Keyboard Shortcut: f)" |
100 | | - data-tour="fit" |
101 | | - uk-tooltip><Fa icon={faExpand} /></button |
| 93 | + class="uk-button uk-button-small" |
| 94 | + class:uk-active={$navMode === NavMode.pan} |
| 95 | + title="Pan Mode<br/>(Keyboard Shortcut: p)" |
| 96 | + class:uk-button-secondary={$navMode === NavMode.pan} |
| 97 | + class:uk-button-default={$navMode !== NavMode.pan} |
| 98 | + uk-tooltip |
| 99 | + on:click|preventDefault={() => ($navMode = NavMode.pan)}><Fa icon={faArrowsAlt} /></button |
102 | 100 | > |
103 | 101 | <button |
104 | 102 | type="button" |
105 | 103 | 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 |
| 104 | + class:uk-active={$navMode === NavMode.crop} |
| 105 | + class:uk-button-secondary={$navMode === NavMode.crop} |
| 106 | + class:uk-button-default={$navMode !== NavMode.crop} |
| 107 | + title="Crop Mode<br/>(Keyboard Shortcut: c)" |
| 108 | + uk-tooltip |
| 109 | + on:click|preventDefault={() => ($navMode = NavMode.crop)}><Fa icon={faCrop} /></button |
| 110 | + > |
| 111 | + <button |
| 112 | + type="button" |
| 113 | + class="uk-button uk-button-small" |
| 114 | + class:uk-active={$navMode === NavMode.zoom} |
| 115 | + class:uk-button-secondary={$navMode === NavMode.zoom} |
| 116 | + class:uk-button-default={$navMode !== NavMode.zoom} |
| 117 | + title="Zoom Mode<br/>(Keyboard Shortcut: z)" |
| 118 | + uk-tooltip |
| 119 | + on:click|preventDefault={() => ($navMode = NavMode.zoom)}><Fa icon={faSearchPlus} /></button |
| 120 | + > |
| 121 | + </div> |
| 122 | + <div class="uk-button-group"> |
| 123 | + <button |
| 124 | + type="button" |
| 125 | + class="uk-button uk-button-default uk-button-small" |
| 126 | + on:click|preventDefault={randomizeColors} |
| 127 | + title="Randomize Colors<br/>(Keyboard Shortcut: r)" |
| 128 | + data-tour="random" |
| 129 | + uk-tooltip><Fa icon={faPaintBrush} /></button |
114 | 130 | > |
115 | 131 | <button |
116 | 132 | type="button" |
|
119 | 135 | class:uk-button-secondary={$isShowingPoints} |
120 | 136 | class:uk-button-default={!$isShowingPoints} |
121 | 137 | on:click|preventDefault={() => ($isShowingPoints = !$isShowingPoints)} |
122 | | - title="Show or Hide points<br/>(Keyboard Shortcut: s)" |
| 138 | + title="Show or Hide Points<br/>(Keyboard Shortcut: s)" |
123 | 139 | data-tour="points" |
124 | 140 | uk-tooltip><Fa icon={faEllipsisH} /></button |
125 | 141 | > |
126 | | - <button |
127 | | - type="button" |
128 | | - class="uk-button uk-button-default uk-button-small" |
129 | | - on:click|preventDefault={scaleMean} |
130 | | - title="Scale by 1/mean" |
131 | | - uk-tooltip><Fa icon={faAnchor} /></button |
132 | | - > |
133 | 142 | <button |
134 | 143 | type="button" |
135 | 144 | class="uk-button uk-button-default uk-button-small" |
|
138 | 147 | uk-tooltip |
139 | 148 | disabled={$activeDatasets.length < 2}><Fa icon={faChartLine} /></button |
140 | 149 | > |
| 150 | + </div> |
| 151 | + <div class="uk-button-group" data-tour="scale"> |
| 152 | + <button |
| 153 | + type="button" |
| 154 | + class="uk-button uk-button-default uk-button-small" |
| 155 | + on:click|preventDefault={scaleMean} |
| 156 | + title="Scale by 1/mean" |
| 157 | + uk-tooltip><Fa icon={faAnchor} /></button |
| 158 | + > |
141 | 159 | <button |
142 | 160 | type="button" |
143 | 161 | class="uk-button uk-button-default uk-button-small" |
144 | 162 | on:click|preventDefault={reset} |
145 | | - title="Reset DataSet Scaling" |
146 | | - uk-tooltip><Fa icon={faReceipt} /></button |
| 163 | + title="Reset Dataset Scaling" |
| 164 | + uk-tooltip><Fa icon={faShuffle} /></button |
147 | 165 | > |
148 | 166 | </div> |
149 | 167 | <div class="uk-button-group"> |
|
166 | 184 | on:click|preventDefault={() => (doDialog = 'directLink')}><Fa icon={faLink} /></button |
167 | 185 | > |
168 | 186 | </div> |
169 | | - <div class="uk-button-group" data-tour="navmode"> |
170 | | - <button |
171 | | - type="button" |
172 | | - class="uk-button uk-button-small" |
173 | | - class:uk-active={$navMode === NavMode.pan} |
174 | | - title="Pan Mode<br/>(Keyboard Shortcut: p)" |
175 | | - class:uk-button-secondary={$navMode === NavMode.pan} |
176 | | - class:uk-button-default={$navMode !== NavMode.pan} |
177 | | - uk-tooltip |
178 | | - on:click|preventDefault={() => ($navMode = NavMode.pan)}><Fa icon={faArrowsAlt} /></button |
179 | | - > |
180 | | - <button |
181 | | - type="button" |
182 | | - class="uk-button uk-button-small" |
183 | | - class:uk-active={$navMode === NavMode.crop} |
184 | | - class:uk-button-secondary={$navMode === NavMode.crop} |
185 | | - class:uk-button-default={$navMode !== NavMode.crop} |
186 | | - title="Crop Mode<br/>(Keyboard Shortcut: c)" |
187 | | - uk-tooltip |
188 | | - on:click|preventDefault={() => ($navMode = NavMode.crop)}><Fa icon={faCrop} /></button |
189 | | - > |
190 | | - <button |
191 | | - type="button" |
192 | | - class="uk-button uk-button-small" |
193 | | - class:uk-active={$navMode === NavMode.zoom} |
194 | | - class:uk-button-secondary={$navMode === NavMode.zoom} |
195 | | - class:uk-button-default={$navMode !== NavMode.zoom} |
196 | | - title="Zoom Mode<br/>(Keyboard Shortcut: z)" |
197 | | - uk-tooltip |
198 | | - on:click|preventDefault={() => ($navMode = NavMode.zoom)}><Fa icon={faSearchPlus} /></button |
199 | | - > |
200 | | - </div> |
201 | 187 | <div class="uk-button-group"> |
202 | 188 | <button |
203 | 189 | type="button" |
|
0 commit comments