|
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'; |
|
55 | 54 | chart.fitData(true); |
56 | 55 | } |
57 | 56 | break; |
| 57 | + case 'a': |
| 58 | + $navMode = NavMode.autofit; |
| 59 | + break; |
58 | 60 | case 'p': |
59 | 61 | $navMode = NavMode.pan; |
60 | 62 | break; |
|
70 | 72 | case 's': |
71 | 73 | $isShowingPoints = !$isShowingPoints; |
72 | 74 | break; |
73 | | - case 'a': |
74 | | - $autoFit = !$autoFit; |
75 | | - break; |
76 | 75 | case 'h': |
77 | 76 | tour.cancel(); |
78 | 77 | tour.start(); |
|
82 | 81 | </script> |
83 | 82 |
|
84 | 83 | <div class="menu" {style} data-tour="top"> |
85 | | - <div class="uk-button-group"> |
| 84 | + <div class="uk-button-group" data-tour="navmode"> |
86 | 85 | <button |
87 | 86 | 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 |
| 87 | + class="uk-button uk-button-small" |
| 88 | + disabled={!chart} |
| 89 | + class:uk-active={$navMode === NavMode.autofit} |
| 90 | + class:uk-button-secondary={$navMode === NavMode.autofit} |
| 91 | + class:uk-button-default={$navMode !== NavMode.autofit} |
| 92 | + on:click|preventDefault={() => ($navMode = NavMode.autofit)} |
| 93 | + title="Autofit Mode<br/>(Keyboard Shortcut: a)" |
| 94 | + uk-tooltip><Fa icon={faExpand} /></button |
93 | 95 | > |
94 | 96 | <button |
95 | 97 | 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 |
| 98 | + class="uk-button uk-button-small" |
| 99 | + class:uk-active={$navMode === NavMode.pan} |
| 100 | + title="Pan Mode<br/>(Keyboard Shortcut: p)" |
| 101 | + class:uk-button-secondary={$navMode === NavMode.pan} |
| 102 | + class:uk-button-default={$navMode !== NavMode.pan} |
| 103 | + uk-tooltip |
| 104 | + on:click|preventDefault={() => ($navMode = NavMode.pan)}><Fa icon={faArrowsAlt} /></button |
102 | 105 | > |
103 | 106 | <button |
104 | 107 | type="button" |
105 | 108 | 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 |
| 109 | + class:uk-active={$navMode === NavMode.crop} |
| 110 | + class:uk-button-secondary={$navMode === NavMode.crop} |
| 111 | + class:uk-button-default={$navMode !== NavMode.crop} |
| 112 | + title="Crop Mode<br/>(Keyboard Shortcut: c)" |
| 113 | + uk-tooltip |
| 114 | + on:click|preventDefault={() => ($navMode = NavMode.crop)}><Fa icon={faCrop} /></button |
| 115 | + > |
| 116 | + <button |
| 117 | + type="button" |
| 118 | + class="uk-button uk-button-small" |
| 119 | + class:uk-active={$navMode === NavMode.zoom} |
| 120 | + class:uk-button-secondary={$navMode === NavMode.zoom} |
| 121 | + class:uk-button-default={$navMode !== NavMode.zoom} |
| 122 | + title="Zoom Mode<br/>(Keyboard Shortcut: z)" |
| 123 | + uk-tooltip |
| 124 | + on:click|preventDefault={() => ($navMode = NavMode.zoom)}><Fa icon={faSearchPlus} /></button |
| 125 | + > |
| 126 | + </div> |
| 127 | + <div class="uk-button-group"> |
| 128 | + <button |
| 129 | + type="button" |
| 130 | + class="uk-button uk-button-default uk-button-small" |
| 131 | + on:click|preventDefault={randomizeColors} |
| 132 | + title="Randomize Colors<br/>(Keyboard Shortcut: r)" |
| 133 | + data-tour="random" |
| 134 | + uk-tooltip><Fa icon={faPaintBrush} /></button |
114 | 135 | > |
115 | 136 | <button |
116 | 137 | type="button" |
|
119 | 140 | class:uk-button-secondary={$isShowingPoints} |
120 | 141 | class:uk-button-default={!$isShowingPoints} |
121 | 142 | on:click|preventDefault={() => ($isShowingPoints = !$isShowingPoints)} |
122 | | - title="Show or Hide points<br/>(Keyboard Shortcut: s)" |
| 143 | + title="Show or Hide Points<br/>(Keyboard Shortcut: s)" |
123 | 144 | data-tour="points" |
124 | 145 | uk-tooltip><Fa icon={faEllipsisH} /></button |
125 | 146 | > |
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 | 147 | <button |
134 | 148 | type="button" |
135 | 149 | class="uk-button uk-button-default uk-button-small" |
|
138 | 152 | uk-tooltip |
139 | 153 | disabled={$activeDatasets.length < 2}><Fa icon={faChartLine} /></button |
140 | 154 | > |
| 155 | + </div> |
| 156 | + <div class="uk-button-group" data-tour="scale"> |
| 157 | + <button |
| 158 | + type="button" |
| 159 | + class="uk-button uk-button-default uk-button-small" |
| 160 | + on:click|preventDefault={scaleMean} |
| 161 | + title="Scale by 1/mean" |
| 162 | + uk-tooltip><Fa icon={faAnchor} /></button |
| 163 | + > |
141 | 164 | <button |
142 | 165 | type="button" |
143 | 166 | class="uk-button uk-button-default uk-button-small" |
144 | 167 | on:click|preventDefault={reset} |
145 | | - title="Reset DataSet Scaling" |
146 | | - uk-tooltip><Fa icon={faReceipt} /></button |
| 168 | + title="Reset Dataset Scaling" |
| 169 | + uk-tooltip><Fa icon={faShuffle} /></button |
147 | 170 | > |
148 | 171 | </div> |
149 | 172 | <div class="uk-button-group"> |
|
166 | 189 | on:click|preventDefault={() => (doDialog = 'directLink')}><Fa icon={faLink} /></button |
167 | 190 | > |
168 | 191 | </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 | 192 | <div class="uk-button-group"> |
202 | 193 | <button |
203 | 194 | type="button" |
|
0 commit comments