Skip to content
Snippets Groups Projects
Commit fea20671 authored by Moustafa Banqusli's avatar Moustafa Banqusli
Browse files

#373 add observations-diagrams schema

parent d7aa3ced
No related branches found
No related tags found
2 merge requests!444Develop into Master,!352Resolve "3 Diagramme für Funde hinzufügen"
......@@ -35,12 +35,12 @@ export function getVisitedTransect(data: Array<{}>, i18n: VueI18n) {
x: {
field: "Start",
type: "temporal",
axis: {title: i18n.t("sharedTable.date").toString()},
axis: {title: ""},
},
y: {
field: "Count",
type: "quantitative",
axis: {title: i18n.t("sharedTable.numberOfTransectsCommitted").toString()},
axis: {title: ""},
},
tooltip: {field: "Count", type: "quantitative"},
},
......@@ -83,12 +83,12 @@ export function getCreatedInspection(data: Array<{}>, i18n: VueI18n) {
x: {
field: "Start",
type: "temporal",
axis: {title: i18n.t("sharedTable.date").toString()},
axis: {title: ""},
},
y: {
field: "Count",
type: "quantitative",
axis: {tickCount: 3, grid: false, title: i18n.t("sharedTable.numberOfInspections").toString()},
axis: {tickCount: 3, grid: false, title: ""},
},
tooltip: {field: "Count", type: "quantitative"},
},
......@@ -115,7 +115,7 @@ export function getCountSpecies(data: Array<{}>, i18n: VueI18n) {
y: {
field: "Count",
type: "quantitative",
axis: {title: i18n.t("sharedTable.numberOfInspections").toString()}
axis: {title: i18n.t("sharedTable.speciesSummarized").toString()},
},
tooltip: {field: "Count", type: "quantitative"},
},
......@@ -130,12 +130,12 @@ export function getCountSpecies(data: Array<{}>, i18n: VueI18n) {
x: {
field: "Start",
type: "temporal",
axis: {title: i18n.t("sharedTable.date").toString()},
axis: {title: ""},
},
y: {
field: "Count",
type: "quantitative",
axis: {tickCount: 3, grid: false, title: i18n.t("sharedTable.numberOfInspections").toString()},
axis: {tickCount: 3, grid: false, title: ""},
},
tooltip: {field: "Count", type: "quantitative"},
},
......@@ -146,47 +146,26 @@ export function getCountSpecies(data: Array<{}>, i18n: VueI18n) {
export function getCountSpeciesBreakdown(data: Array<{}>, i18n: VueI18n) {
return {
width: "container",
data: {
values: data,
data: {values: data,
},
vconcat: [{
width: 1100,
mark: "bar",
encoding: {
x: {
field: "Start",
type: "temporal",
scale: {domain: {selection: "brush"}},
axis: {title: i18n.t("sharedTable.date").toString()},
},
y: {
field: "Count",
type: "quantitative",
axis: {title: i18n.t("sharedTable.numberOfInspections").toString()}
},
tooltip: {field: "Count", type: "quantitative"},
mark: "bar",
encoding: {
x: {
field: "Start",
type: "temporal",
timeUnit: "utcmonthdate",
axis: {title: i18n.t("sharedTable.date").toString()},
},
}, {
width: 1100,
height: 60,
mark: "bar",
selection: {
brush: {type: "interval", encodings: ["x"]},
},
encoding: {
x: {
field: "Start",
type: "temporal",
axis: {title: i18n.t("sharedTable.date").toString()},
},
y: {
field: "Count",
type: "quantitative",
axis: {tickCount: 3, grid: false, title: i18n.t("sharedTable.numberOfInspections").toString()},
},
tooltip: {field: "Count", type: "quantitative"},
y: {
aggregate: "sum",
field: "Count",
type: "quantitative",
axis: {grid: false, title: i18n.t("sharedTable.speciesSeparated").toString()},
},
}],
column: {field: "Species", type: "ordinal", axis: null},
color: {field: "Count", type: "nominal", scale: {range: ["#675193", "#118861", "#225193", "#335193", "#670093", "#675593"]}},
},
config: {view: {stroke: "transparent"}, axis: {domainWidth: 1}},
};
}
......@@ -207,11 +186,11 @@ export function getObservationIndex(data: Array<{}>, i18n: VueI18n) {
axis: {title: i18n.t("sharedTable.date").toString()},
},
y: {
field: "Count",
field: "Index",
type: "quantitative",
axis: {title: i18n.t("sharedTable.numberOfInspections").toString()}
axis: {title: i18n.t("sharedTable.indexNumberOfObservations").toString()},
},
tooltip: {field: "Count", type: "quantitative"},
tooltip: {field: "Index", type: "quantitative"},
},
}, {
width: 1100,
......@@ -224,14 +203,14 @@ export function getObservationIndex(data: Array<{}>, i18n: VueI18n) {
x: {
field: "Start",
type: "temporal",
axis: {title: i18n.t("sharedTable.date").toString()},
axis: {title: ""},
},
y: {
field: "Count",
field: "Index",
type: "quantitative",
axis: {tickCount: 3, grid: false, title: i18n.t("sharedTable.numberOfInspections").toString()},
axis: {tickCount: 3, grid: false, title: ""},
},
tooltip: {field: "Count", type: "quantitative"},
tooltip: {field: "Index", type: "quantitative"},
},
}],
};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment