Skip to content

Commit 918688b

Browse files
committed
feat: vis_type in the requestPdfLookup
1 parent 844555f commit 918688b

1 file changed

Lines changed: 9 additions & 4 deletions

File tree

vis/js/utils/usePdfLookup.ts

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { isFileAvailable } from "./data";
55
import { Paper } from "../@types/paper";
66
import { useSelector } from "react-redux";
77
import { ensureThatURLStartsWithHTTP } from "./url";
8+
import { VisualizationTypes } from "../@types/visualization-types";
89

910
const getVisualizationIdFromStore = (state: any): string => {
1011
return state.data.options.visualizationId;
@@ -68,6 +69,10 @@ const usePdfLookup = (paper: Paper, serverUrl: string, service: string) => {
6869
fallbackUrl = paper.outlink;
6970
}
7071

72+
const visualizationType: VisualizationTypes = isStreamgraph
73+
? "timeline"
74+
: "overview";
75+
7176
requestPdfLookup(
7277
serverUrl,
7378
articleUrl,
@@ -76,7 +81,7 @@ const usePdfLookup = (paper: Paper, serverUrl: string, service: string) => {
7681
possiblePDFs,
7782
visualizationId,
7883
paper.id,
79-
isStreamgraph
84+
visualizationType
8085
)
8186
.done((data) => {
8287
if (data.status === "success") {
@@ -114,7 +119,7 @@ const requestPdfLookup = (
114119
pdfURLs: string,
115120
visualizationId: string,
116121
paperId: string,
117-
isStreamgraph: boolean
122+
visualizationType: VisualizationTypes
118123
) => {
119124
const SCRIPT_PATH_ON_SERVER = "services/getPDF.php";
120125

@@ -126,9 +131,9 @@ const requestPdfLookup = (
126131
filename,
127132
service,
128133
pdf_urls: pdfURLs,
129-
vis_id: visualizationId,
130134
paper_id: paperId,
131-
is_streamgraph: String(isStreamgraph),
135+
vis_id: visualizationId,
136+
vis_type: visualizationType,
132137
});
133138

134139
requestURL.search = requestParameters.toString();

0 commit comments

Comments
 (0)