Skip to content

Commit ae0f696

Browse files
authored
Merge pull request #116 from cmu-delphi/release/v2.1.10
Release v2.1.10
2 parents c1b17e1 + b8e8687 commit ae0f696

File tree

5 files changed

+18
-8
lines changed

5 files changed

+18
-8
lines changed

package-lock.json

Lines changed: 2 additions & 2 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 & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "www-epivis",
3-
"version": "2.1.9",
3+
"version": "2.1.10",
44
"private": true,
55
"license": "MIT",
66
"description": "",

src/components/dialogs/ImportAPIDialog.svelte

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,12 @@
7474
bind:group={$formSelections.dataSource}
7575
value="covidcast"
7676
/>
77-
Delphi Indicators (aka COVIDcast) (source:
78-
<a target="_blank" href="https://delphi.cmu.edu/">delphi.cmu.edu</a>)</label
77+
Delphi Indicators (aka COVIDcast) (docs:
78+
<a
79+
target="_blank"
80+
href="https://cmu-delphi.github.io/delphi-epidata/api/covidcast_signals.html#all-available-sources-and-signals"
81+
>cmu-delphi.github.io</a
82+
>)</label
7983
>
8084
<label
8185
><input

src/deriveLinkDefaults.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import {
1414
importTwitter,
1515
importWiki,
1616
} from './api/EpiData';
17+
import { NavMode } from './components/chartUtils';
1718
import DataSet, { DataGroup, DEFAULT_GROUP, flatten, DEFAULT_VIEWPORT } from './data/DataSet';
1819
import EpiDate from './data/EpiDate';
1920
import EpiPoint from './data/EpiPoint';
@@ -35,13 +36,15 @@ export interface SharedState {
3536
active: DataSet[];
3637
viewport: null | [number, number, number, number];
3738
showPoints: boolean;
39+
navMode: NavMode;
3840
}
3941

4042
const DEFAULT_VALUES: SharedState = {
4143
group: DEFAULT_GROUP,
4244
active: [],
4345
viewport: DEFAULT_VIEWPORT,
4446
showPoints: false,
47+
navMode: NavMode.pan,
4548
};
4649

4750
const lookups = {
@@ -202,6 +205,8 @@ export default function deriveLinkDefaults(): SharedState & { loader?: ReturnTyp
202205
active: [],
203206
showPoints: parsed.chart?.showPoints ?? DEFAULT_VALUES.showPoints,
204207
viewport: parsed.chart?.viewport ?? DEFAULT_VALUES.viewport,
208+
// if we were not passed viewport coords, set to autofit mode
209+
navMode: parsed.chart?.viewport ? DEFAULT_VALUES.navMode : NavMode.autofit,
205210
loader: initialLoader(parsed.datasets),
206211
};
207212
} catch (err) {
@@ -214,7 +219,8 @@ export default function deriveLinkDefaults(): SharedState & { loader?: ReturnTyp
214219
export function getDirectLinkImpl(state: SharedState): { url: URL; anySkipped: boolean } {
215220
const config: ILinkConfig = {
216221
chart: {
217-
viewport: state.viewport ?? [0, 0, 0, 0],
222+
// if in autofit mode, pass null viewport, else preserve viewport (or default to 0s)
223+
viewport: state.navMode == NavMode.autofit ? null : state.viewport ?? [0, 0, 0, 0],
218224
showPoints: state.showPoints,
219225
},
220226
datasets: [],

src/store.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { get, writable } from 'svelte/store';
2-
import { NavMode } from './components/chartUtils';
32
import DataSet, { DataGroup } from './data/DataSet';
43
import deriveLinkDefaults, { getDirectLinkImpl } from './deriveLinkDefaults';
54
import FormSelections from './components/dialogs/formSelections';
@@ -16,7 +15,7 @@ export const expandedDataGroups = writable([defaults.group]);
1615

1716
export const isShowingPoints = writable(defaults.showPoints);
1817
export const initialViewport = writable(defaults.viewport);
19-
export const navMode = writable(NavMode.autofit);
18+
export const navMode = writable(defaults.navMode);
2019

2120
export function getFormSelections() {
2221
try {
@@ -97,6 +96,7 @@ export function getDirectLink(chart: IChart): { url: URL; anySkipped: boolean }
9796
active: get(activeDatasets),
9897
showPoints: get(isShowingPoints),
9998
viewport: chart.getViewport(),
99+
navMode: get(navMode),
100100
});
101101
}
102102

0 commit comments

Comments
 (0)