Commit 3deb86a1 authored by Markus Scheidgen's avatar Markus Scheidgen
Browse files

Merge branch 'gui-fixes' into 'v1.0.2'

Merged gui-fixes into v1.0.2

See merge request !551
parents ae988ff0 95a61d4d
Pipeline #121358 passed with stages
in 24 minutes and 14 seconds
......@@ -1367,7 +1367,7 @@ function toAPIAgg(aggs, updatedFilters, resource) {
for (const [type, options] of Object.entries(data)) {
const exclude = options.exclude
? options.exclude(updatedFilters)
: updatedFilters.has(key) && filterDataGlobal[key].exclusive
: filterDataGlobal[key].exclusive
const name = resource === 'materials' ? materialNames[quantity.split(':')[0]] : quantity
const apiAgg = apiAggs[name] || {}
apiAgg[type] = {
......
......@@ -107,11 +107,7 @@ const InputField = React.memo(({
if (isArray(metainfoOptions) && metainfoOptions.length > 0) {
const opt = {}
for (const name of metainfoOptions) {
// We do not display the option for 'not processed': it is more of a
// debug value
if (name !== 'not processed') {
opt[name] = {label: name}
}
opt[name] = {label: name}
}
return opt
}
......@@ -150,7 +146,10 @@ const InputField = React.memo(({
// Form the final list of options. If no fixed options are available, the
// options are gathered from the aggregation.
const finalOptions = useMemo(() => {
// We do not display the option for 'not processed': it is more of a
// debug value
if (fixedOptions) {
delete fixedOptions['not processed']
return fixedOptions
}
if (agg?.data) {
......
......@@ -354,7 +354,14 @@ const InputPeriodicTable = React.memo(({
disabled={!availableValues[element.symbol]}
onClick={() => onElementClicked(element.symbol)}
selected={localFilter.current.has(element.symbol)}
max={agg ? Math.max(...agg.data.map(option => option.count)) : 0}
// The colors are normalized with respect to the maximum
// aggregation size for an unselected element.
max={agg
? Math.max(...agg.data
.filter(option => !localFilter.current.has(option.value))
.map(option => option.count))
: 0
}
count={availableValues[element.symbol]}
localFilter={localFilter.current}
scale={scale}
......
Supports Markdown
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