Commit 5a8eced7 authored by Przemyslaw Kaminski's avatar Przemyslaw Kaminski

[charts] fixes to bar chart

parent d51a608e
......@@ -16,6 +16,10 @@
.tree .node {
margin-top: 1px;
}
.tree .node.node-type-valid .text {
color: blue;
text-decoration: underline;
}
.tree .lefthanded ul {
margin-right: 19px;
}
......
......@@ -11,6 +11,10 @@
cursor: wait
.node
margin-top: 1px
&.node-type-valid
.text
color: blue
text-decoration: underline
.lefthanded
ul
margin-right : 19px
......
......@@ -121,14 +121,8 @@ subTreeTreeViewCpt = R2.hooksComponent thisModule "subTreeTreeViewCpt" cpt
GT.RightHanded -> identity
pure $ H.div {} $ ordering [
H.div { className: "node " <> GT.fldr nodeType true} [
H.span { style : if validNodeType then
{ color : "blue"
, "text-decoration": "underline"
}
else { color : ""
, "text-decoration": "none"
}
H.div { className: nodeClass validNodeType } [
H.span { className: "text"
, on: { click: onClick }
} [
nodeText { isSelected: isSelected targetId valAction
......@@ -141,6 +135,10 @@ subTreeTreeViewCpt = R2.hooksComponent thisModule "subTreeTreeViewCpt" cpt
]
where
nodeClass vnt = "node " <> GT.fldr nodeType true <> " " <> validNodeTypeClass
where
validNodeTypeClass = if vnt then "node-type-valid" else ""
SubTreeParams { valitypes } = subTreeParams
sortedAry = A.sortWith (\(NTree (LNode {id:id'}) _) -> id')
......@@ -152,7 +150,7 @@ subTreeTreeViewCpt = R2.hooksComponent thisModule "subTreeTreeViewCpt" cpt
clickable = if validNodeType then "clickable" else ""
( valAction /\ setAction) = action
(valAction /\ setAction) = action
isSelected n action' = case (subTreeOut action') of
Nothing -> false
......
......@@ -559,10 +559,6 @@ mainNgramsTablePaintCpt :: R.Component MainNgramsTablePaintProps
mainNgramsTablePaintCpt = R2.hooksComponent thisModule "mainNgramsTablePaint" cpt
where
cpt {path, tabNgramType, versioned, withAutoUpdate} _ = do
R.useEffect' $ do
let (Versioned v) = versioned
log2 "[mainNgramsTablePaint] versioned values" $ show v.data
pathS <- R.useState' path
state <- R.useState' $ initialState versioned
......
......@@ -69,6 +69,7 @@ annuaireLayoutWithKeyCpt = R2.hooksComponent thisModule "annuaireLayoutWithKey"
where
cpt { frontends, nodeId, session } _ = do
path <- R.useState' nodeId
useLoader (fst path) (getAnnuaireInfo session) $
\info -> annuaire { frontends, info, path, session }
......
......@@ -108,6 +108,7 @@ pieCpt = R2.hooksComponent thisModule "pie" cpt
where
cpt { path, session } _ = do
reload <- R.useState' 0
pure $ metricsWithCacheLoadView {
getMetricsHash
, handleResponse
......@@ -120,7 +121,8 @@ pieCpt = R2.hooksComponent thisModule "pie" cpt
loadedPie :: Record MetricsProps -> HistoMetrics -> R.Element
loadedPie { path, reload, session } loaded =
H.div {} [ U.reloadButton reload
H.div {} [
U.reloadButton reload
, U.chartUpdateButton { chartType: ChartPie, path, reload, session }
, chart $ chartOptionsPie loaded
]
......@@ -134,11 +136,11 @@ barCpt = R2.hooksComponent thisModule "bar" cpt
where
cpt {path, session} _ = do
reload <- R.useState' 0
--pure $ metricsLoadView {getMetrics, loaded: loadedBar, path, reload, session}
pure $ metricsWithCacheLoadView
{ getMetricsHash
pure $ metricsWithCacheLoadView {
getMetricsHash
, handleResponse
, loaded: loadedPie
, loaded: loadedBar
, mkRequest: mkRequest session
, path
, reload
......
......@@ -103,7 +103,8 @@ ngramsViewCpt = R2.hooksComponent thisModule "ngramsView" cpt
, getChartFunction chartType $ { session, path }
]
charts _ _ = [ chart mode ]
chart Authors = pie { session, path }
chart Sources = bar { session, path }
chart Institutes = tree { session, path }
chart Sources = bar { session, path }
chart Terms = metrics { session, path }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment