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

[charts] fixes to bar chart

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