...
 
Commits (3)
// Production server config
module.exports = {
apiBaseUrl: "https://api.db.nomics.world/v21",
seriesEndpointLimit: 1000,
apiBaseUrl: "https://api.db.nomics.world/v22",
seriesEndpointLimit: 1000
}
......@@ -305,64 +305,68 @@ viewSeriesTables seriesList =
viewSeriesTabs : String -> Int -> SeriesListTab -> Set SeriesId -> Set ( SeriesId, SeriesName ) -> Dropdown.State -> Dict SeriesId Dropdown.State -> List Series -> Html Msg
viewSeriesTabs apiBaseUrl seriesEndpointLimit activeTab displayedGraphSeriesIds cartSeriesTuples wholeCartDropdownState seriesDropdownStates seriesList =
div [] <|
[ div [ class "d-flex justify-content-end mb-3" ]
[ button
[ class "btn btn-secondary mr-3"
, onClick RemoveAll
, title "Remove all time series from the cart"
]
[ text "Empty cart" ]
, downloadSeriesDropdown []
[ Button.primary
, Button.attrs [ title "Download cart's series in several file formats" ]
]
seriesEndpointLimit
wholeCartDropdownState
(DownloadDropdownMsg WholeCartDropdown)
(Requests.seriesByIdsUrl apiBaseUrl
(cartSeriesTuples
|> Set.map Tuple.first
|> Set.toList
)
)
]
, viewTabs activeTab TabChange
, case activeTab of
ListTab ->
Keyed.node "div"
[]
[ ( "list-tab-pane"
, div [] <|
lineSeparatedList False
(cartSeriesTuples
|> Set.toList
|> List.map (viewSeriesListItem apiBaseUrl seriesEndpointLimit displayedGraphSeriesIds seriesDropdownStates)
)
)
]
let
cartSeriesIds =
cartSeriesTuples
|> Set.map Tuple.first
|> Set.toList
TableTab ->
Keyed.node "div"
[]
[ ( "table-tab-pane"
, div [] <|
viewSeriesTables seriesList
)
makeApiUrl =
Requests.seriesByIdsUrl apiBaseUrl cartSeriesIds
in
div [] <|
[ div [ class "d-flex justify-content-end mb-3" ]
[ button
[ class "btn btn-secondary mr-3"
, onClick RemoveAll
, title "Remove all time series from the cart"
]
GraphTab ->
Keyed.node "div"
[]
[ ( "graph-tab-pane"
, div
[ id multiSeriesGraphElementId
, class "my-3"
]
[]
)
[ text "Empty cart" ]
, downloadSeriesDropdown []
[ Button.primary
, Button.attrs [ title "Download cart's series in several file formats" ]
]
]
seriesEndpointLimit
wholeCartDropdownState
(DownloadDropdownMsg WholeCartDropdown)
makeApiUrl
]
, viewTabs activeTab TabChange
, case activeTab of
ListTab ->
Keyed.node "div"
[]
[ ( "list-tab-pane"
, div [] <|
lineSeparatedList False
(cartSeriesTuples
|> Set.toList
|> List.map (viewSeriesListItem apiBaseUrl seriesEndpointLimit displayedGraphSeriesIds seriesDropdownStates)
)
)
]
TableTab ->
Keyed.node "div"
[]
[ ( "table-tab-pane"
, div [] <|
viewSeriesTables seriesList
)
]
GraphTab ->
Keyed.node "div"
[]
[ ( "graph-tab-pane"
, div
[ id multiSeriesGraphElementId
, class "my-3"
]
[]
)
]
]
viewTabs : SeriesListTab -> (SeriesListTab -> msg) -> Html msg
......
......@@ -601,11 +601,11 @@ viewSeriesTable providerCode dataset dimensionsCodesOrder seriesList =
List.map
(\{ code, name, value, dimensions } ->
tr [] <|
[ th []
[ th [ style [ ( "max-width", "10em" ) ] ]
[ a
[ Route.href <| Route.Series providerCode dataset.code code
, title name
, class "text-nowrap"
, style [ ( "overflow-wrap", "break-word" ) ]
]
[ text code ]
]
......
......@@ -49,7 +49,17 @@ seriesByDimensionUrl apiBaseUrl providerCode datasetCode selectedDimensions sear
++ limitQueryStringParam limit
++ [ ( "observations", "1" )
, ( "format", formatApiOutputFormat apiOutputFormat )
, ( "align_periods", "1" )
, ( "align_periods"
, case apiOutputFormat of
CsvFormat ->
"1"
XlsxFormat ->
"1"
JsonFormat ->
"0"
)
, ( "offset", toString offset )
, ( "facets", formatBoolAsIntStr facets )
]
......@@ -73,10 +83,15 @@ seriesByIdsUrl apiBaseUrl seriesIds apiOutputFormat =
, ( "observations", "1" )
, ( "format", formatApiOutputFormat apiOutputFormat )
, ( "align_periods"
, if List.length seriesIds > 1 then
"1"
else
"0"
, case apiOutputFormat of
CsvFormat ->
"1"
XlsxFormat ->
"1"
JsonFormat ->
"0"
)
]
......