Skip to content
Snippets Groups Projects
Commit b9e027a8 authored by esikkala's avatar esikkala
Browse files

Polygon layer: set fill opacity

parent f19baf9d
No related branches found
No related tags found
No related merge requests found
......@@ -199,7 +199,7 @@ class Deck extends React.Component {
filled: true,
lineWidthMinPixels: 1,
getPolygon: d => d.polygon,
getFillColor: d => [255, 0, 0, 30],
getFillColor: d => [255, 0, 0, d.instanceCountScaled],
getLineColor: [80, 80, 80],
getLineWidth: 1
})
......@@ -270,6 +270,21 @@ class Deck extends React.Component {
viewState={this.state.viewport}
layers={[layer]}
getCursor={() => 'initial'}
{...(layerType === 'polygonLayer'
? {
getTooltip: ({ object }) => object && {
html: `
<h2>${object.prefLabel}</h2>
<div>${object.instanceCount}</div>
`
// style: {
// backgroundColor: '#f00',
// fontSize: '0.8em'
// }
}
}
: {})
}
/>
{this.renderSpinner()}
{layerType === 'arcLayer' && this.props.instanceAnalysisData && this.state.dialog.open &&
......
......@@ -208,13 +208,13 @@ const Perspective1 = props => {
path={`${rootUrl}/${perspective.id}/faceted-search/choropleth_map`}
render={() =>
<Deck
center={props.perspectiveState.maps.placesMsMigrations.center}
zoom={props.perspectiveState.maps.placesMsMigrations.zoom}
center={props.perspectiveState.maps.casualtiesByMunicipality.center}
zoom={props.perspectiveState.maps.casualtiesByMunicipality.zoom}
results={props.perspectiveState.results}
facetUpdateID={props.facetState.facetUpdateID}
instanceAnalysisData={props.perspectiveState.instanceAnalysisData}
instanceAnalysisDataUpdateID={props.perspectiveState.instanceAnalysisDataUpdateID}
resultClass='choropleth'
resultClass='casualtiesByMunicipality'
facetClass='perspective1'
fetchResults={props.fetchResults}
fetchInstanceAnalysis={props.fetchInstanceAnalysis}
......
......@@ -37,6 +37,10 @@ export const INITIAL_STATE = {
placesMsMigrations: {
center: [22.43, 10.37],
zoom: 2
},
casualtiesByMunicipality: {
center: [65.184809, 27.314050],
zoom: 4
}
},
properties: [
......@@ -292,7 +296,7 @@ const resultClasses = new Set([
'manuscriptFacetResultsNetwork',
'perspective1KnowledgeGraphMetadata',
'speechesByYearAndParty',
'choropleth'
'casualtiesByMunicipality'
])
const perspective1 = (state = INITIAL_STATE, action) => {
......
......@@ -170,7 +170,7 @@ export const backendSearchConfig = {
}
}
},
choropleth: {
casualtiesByMunicipality: {
perspectiveID: 'warsa',
q: choroplethQuery,
resultMapper: makeObjectList,
......@@ -179,7 +179,7 @@ export const backendSearchConfig = {
config: {
variable: 'instanceCount',
minAllowed: 0,
maxAllowed: 1
maxAllowed: 255
}
}
},
......
......@@ -603,7 +603,7 @@ export const choroplethQuery = `
?id a <http://www.yso.fi/onto/suo/kunta> ;
skos:prefLabel ?prefLabel ;
sch:polygon ?polygon .
?death crm-org:P7_took_place_at ?id .
OPTIONAL { ?death crm-org:P7_took_place_at ?id }
}
GROUP BY ?id ?prefLabel ?polygon
ORDER BY desc(?instanceCount)
......
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