Commit 5965fce8 authored by amarcic's avatar amarcic
Browse files

histogram, highlighting: added display of highlighted to histogram

parent 36ffbdbc
......@@ -38,7 +38,7 @@ const initialInput = {
selectedMarker: undefined,
timelineSort: "period",
highlightedTimelineObject: undefined,
highlightedObjects: ["1080824"],
highlightedObjects: [],
areaA: 1,
areaB: 0,
bigTileArea: "",
......@@ -384,6 +384,7 @@ export const AppContent = () => {
timelineObjectsData={dataObjects?.entitiesMultiFilter.flatMap(timelineAdapter)}
/>
|| input[area]===1 && <Histogram
reducer={[input, dispatch]}
timelineData={dataObjects?.entitiesMultiFilter.map(timelineMapper)}
/>
}
......
......@@ -10,6 +10,7 @@ export const Histogram = (props) => {
const classes = useStyles();
const [input, dispatch] = props.reducer;
console.log(props.timelineData);
const preparedData = prepareHistogramData(props.timelineData)?.filter( e => e&&e );
//console.log("data prepared for histogram: ", preparedData);
......@@ -77,7 +78,7 @@ export const Histogram = (props) => {
.attr("transform",`translate(${margin.left}, ${margin.top})`)
.selectAll("rect").data(binnedData).join(
enter => enter.append("rect")
).attr("class","bar")
).attr("class", value => value.values.some( id => input.highlightedObjects.indexOf(id) > -1 ) ? "bar highlighted" : "bar")
//.attr("y", value => y(value.values.length))
.attr("y", height*-1)
.attr("x", value => x(value.lower))
......
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