Update visualisation spec constraint problem
tangrammer opened this issue · comments
Juan A. Ruz commented
Context
https://akvoo.reamaze.com/admin/conversations/akvolumen-support-request-number-419854-from-mert-at-akvo-dot-org
Relates #2979
Link filter to k8s search console
and finding data problem here
** reproducing the problem
(s/explain-str :akvo.lumen.specs.visualisation/visualisation
{:id "5f3a97c5-d0f7-40b7-9d34-2c83b0a876c2",
:datasetId "5f043cf4-e6cc-419f-9b32-94b22b2fed17",
:name "13. Oogsturen per VB per product over de tijd",
:visualisationType "scatter",
:spec
{:showLegend true,
:metricColumnX "c114010004",
:metricAggregation "mean",
:metricColumnSize "c112030004",
:filters [],
:sizeLabel "Oogst in kg",
:axisLabelYFromUser true,
:legendPosition "right",
:bucketColumn nil,
:metricColumnY "c130280002",
:legend
{:order
{:list
["A. De Overtuin"
"C. Mijn Stadstuin"
"F. Voedselrijk"
"I. Schijndel Hardekamp"
"O. Benthuizen"
"P. De Stomp"
"S. D'ekkers"
nil],
:mode "custom"}},
:bucketColumnCategory "c142470029",
:axisLabelX "Op welke datum is er geoogst?",
:datapointLabelColumn "d2",
:sizeLabelFromUser true,
:legendTitle "Voedselbos",
:axisLabelXFromUser true,
:categoryLabelFromUser true,
:categoryLabel "Voedselbos:",
:axisLabelY "Hoelang heeft het oogsten geduurd? (in minuten)",
:version 2},
:created 1597675461314,
:modified 1603379626461})
"nil - failed: string? in: [:spec :legend :order :list 7] at: [\"scatter\" :spec :legend :order :list] spec: :akvo.lumen.specs.visualisation.legend.order/value\n"
Why do we add this issue?
Problem or idea
Problem is having null values in legends
Solution or next step
modified backend/specs/akvo/lumen/specs/visualisation/legend.clj
@@ -8,7 +8,7 @@
(s/def ::order.s/mode #{"auto" "custom"})
-(s/def ::order.s/value string?)
+(s/def ::order.s/value (s/nilable string?))
(s/def ::order.s/list (s/coll-of ::order.s/value :distinct true))