diff --git a/src/html/component/observations-editor/observations-import/observations-import.html b/src/html/component/observations-editor/observations-import/observations-import.html index e28658d..f0f0e4a 100644 --- a/src/html/component/observations-editor/observations-import/observations-import.html +++ b/src/html/component/observations-editor/observations-import/observations-import.html @@ -1,11 +1,6 @@ - - - - - - Observations import - - - - - \ No newline at end of file + + + + + + diff --git a/src/html/component/observations-editor/observations-import/observations-import.less b/src/html/component/observations-editor/observations-import/observations-import.less index 67917f4..c214e75 100644 --- a/src/html/component/observations-editor/observations-import/observations-import.less +++ b/src/html/component/observations-editor/observations-import/observations-import.less @@ -2,6 +2,8 @@ #import-wrapper { height: 100%; + margin: 0.5em; + color: @text-light; } #table-wrapper { @@ -87,3 +89,12 @@ h1 { transform: rotate(360deg); } } + +@media (prefers-color-scheme: dark) { + h1 { + color: @text-dark; + } + .sk-cube-grid .sk-cube { + background-color: @text-dark; + } +} diff --git a/src/html/component/observations-editor/observations-import/observations-import.ts b/src/html/component/observations-editor/observations-import/observations-import.ts index bc7419d..bc10cb0 100644 --- a/src/html/component/observations-editor/observations-import/observations-import.ts +++ b/src/html/component/observations-editor/observations-import/observations-import.ts @@ -80,7 +80,7 @@ export default class ObservationsImport extends LitElement {

Select rows to be imported

${this.table} - -
- ` - } -} diff --git a/src/html/component/properties-editor/dynamic/dynamic-has-attractor/dynamic-has-attractor.less b/src/html/component/properties-editor/dynamic/dynamic-has-attractor/dynamic-has-attractor.less deleted file mode 100644 index 75c7502..0000000 --- a/src/html/component/properties-editor/dynamic/dynamic-has-attractor/dynamic-has-attractor.less +++ /dev/null @@ -1 +0,0 @@ -@import "../../abstract-property/abstract-property"; diff --git a/src/html/component/properties-editor/dynamic/dynamic-has-attractor/dynamic-has-attractor.ts b/src/html/component/properties-editor/dynamic/dynamic-has-attractor/dynamic-has-attractor.ts deleted file mode 100644 index 3dd0ca1..0000000 --- a/src/html/component/properties-editor/dynamic/dynamic-has-attractor/dynamic-has-attractor.ts +++ /dev/null @@ -1,82 +0,0 @@ -import { css, html, type TemplateResult, unsafeCSS } from 'lit' -import { customElement, property, query } from 'lit/decorators.js' -import style_less from './dynamic-has-attractor.less?inline' -import { icon } from '@fortawesome/fontawesome-svg-core' -import { faTrash } from '@fortawesome/free-solid-svg-icons' -import { type IHasAttractorDynamicProperty, type IObservationSet } from '../../../../util/data-interfaces' -import { map } from 'lit/directives/map.js' -import { when } from 'lit/directives/when.js' -import AbstractDynamicProperty from '../abstract-dynamic-property' - -const ALL_OBSERVATIONS_PLACEHOLDER = '*' - -@customElement('dynamic-has-attractor') -export default class DynamicHasAttractor extends AbstractDynamicProperty { - static styles = css`${unsafeCSS(style_less)}` - @query('#observation') declare observationSelector: HTMLSelectElement - @property() declare property: IHasAttractorDynamicProperty - @property() observations: IObservationSet[] = [] - - datasetChanged (event: Event): void { - const datasetId = (event.target as HTMLSelectElement).value - this.updateProperty({ - ...this.property, - dataset: datasetId, - observation: ALL_OBSERVATIONS_PLACEHOLDER - }) - this.observationSelector.selectedIndex = 0 - } - - observationChanged (event: Event): void { - const observation = (event.target as HTMLSelectElement).value - this.updateProperty({ - ...this.property, - observation - }) - } - - render (): TemplateResult { - return html` -
-
- - -
-
-
- -
- -
-
-
- -
- -
-
-
-
-
- ` - } -} diff --git a/src/html/component/properties-editor/dynamic/dynamic-trap-space/dynamic-trap-space.less b/src/html/component/properties-editor/dynamic/dynamic-obs-selection/dynamic-obs-selection.less similarity index 100% rename from src/html/component/properties-editor/dynamic/dynamic-trap-space/dynamic-trap-space.less rename to src/html/component/properties-editor/dynamic/dynamic-obs-selection/dynamic-obs-selection.less diff --git a/src/html/component/properties-editor/dynamic/dynamic-trap-space/dynamic-trap-space.ts b/src/html/component/properties-editor/dynamic/dynamic-obs-selection/dynamic-obs-selection.ts similarity index 59% rename from src/html/component/properties-editor/dynamic/dynamic-trap-space/dynamic-trap-space.ts rename to src/html/component/properties-editor/dynamic/dynamic-obs-selection/dynamic-obs-selection.ts index e05cb51..def77e6 100644 --- a/src/html/component/properties-editor/dynamic/dynamic-trap-space/dynamic-trap-space.ts +++ b/src/html/component/properties-editor/dynamic/dynamic-obs-selection/dynamic-obs-selection.ts @@ -1,14 +1,21 @@ import { css, html, type TemplateResult, unsafeCSS } from 'lit' import { customElement, property, query } from 'lit/decorators.js' -import style_less from './dynamic-trap-space.less?inline' +import style_less from './dynamic-obs-selection.less?inline' import { icon } from '@fortawesome/fontawesome-svg-core' import { faTrash } from '@fortawesome/free-solid-svg-icons' -import { type IObservationSet, type ITrapSpaceDynamicProperty } from '../../../../util/data-interfaces' +import { + DynamicPropertyType, + type IObservationSet, + type ITrapSpaceDynamicProperty +} from '../../../../util/data-interfaces' import { map } from 'lit/directives/map.js' import AbstractDynamicProperty from '../abstract-dynamic-property' +import { when } from 'lit/directives/when.js' -@customElement('dynamic-trap-space') -export default class DynamicTrapSpace extends AbstractDynamicProperty { +const ALL = '*' + +@customElement('dynamic-obs-selection') +export default class DynamicObsSelection extends AbstractDynamicProperty { static styles = css`${unsafeCSS(style_less)}` @property() declare property: ITrapSpaceDynamicProperty @property() declare observations: IObservationSet[] @@ -18,17 +25,19 @@ export default class DynamicTrapSpace extends AbstractDynamicProperty { const datasetId = (event.target as HTMLSelectElement).value this.updateProperty({ ...this.property, - dataset: datasetId, - observation: '' + dataset: datasetId === '' ? undefined : datasetId, + observation: this.property.variant === DynamicPropertyType.HasAttractor ? ALL : undefined }) - this.observationSelector.selectedIndex = 0 + if (this.property.variant !== DynamicPropertyType.ExistsTrajectory) { + this.observationSelector.selectedIndex = 0 + } } observationChanged (event: Event): void { const observation = (event.target as HTMLSelectElement).value this.updateProperty({ ...this.property, - observation + observation: observation === '' ? undefined : observation }) } @@ -56,6 +65,7 @@ export default class DynamicTrapSpace extends AbstractDynamicProperty { ${icon(faTrash).node}
+
@@ -68,32 +78,41 @@ export default class DynamicTrapSpace extends AbstractDynamicProperty {
+ + ${when(this.property.variant !== DynamicPropertyType.ExistsTrajectory, () => html`
-
- -
-
- - -
-
- - -
+
`)} + + ${when(this.property.variant === DynamicPropertyType.TrapSpace, () => html` +
+
+ + +
+
+ + +
+
`)}
` diff --git a/src/html/component/properties-editor/dynamic/dynamic-trajectory/dynamic-trajectory.less b/src/html/component/properties-editor/dynamic/dynamic-trajectory/dynamic-trajectory.less deleted file mode 100644 index 75c7502..0000000 --- a/src/html/component/properties-editor/dynamic/dynamic-trajectory/dynamic-trajectory.less +++ /dev/null @@ -1 +0,0 @@ -@import "../../abstract-property/abstract-property"; diff --git a/src/html/component/properties-editor/dynamic/dynamic-trajectory/dynamic-trajectory.ts b/src/html/component/properties-editor/dynamic/dynamic-trajectory/dynamic-trajectory.ts deleted file mode 100644 index 622a030..0000000 --- a/src/html/component/properties-editor/dynamic/dynamic-trajectory/dynamic-trajectory.ts +++ /dev/null @@ -1,51 +0,0 @@ -import { css, html, type TemplateResult, unsafeCSS } from 'lit' -import { customElement, property, query } from 'lit/decorators.js' -import style_less from './dynamic-trajectory.less?inline' -import { icon } from '@fortawesome/fontawesome-svg-core' -import { faTrash } from '@fortawesome/free-solid-svg-icons' -import { map } from 'lit/directives/map.js' - -import { type IExistsTrajectoryDynamicProperty, type IObservationSet } from '../../../../util/data-interfaces' -import AbstractDynamicProperty from '../abstract-dynamic-property' - -@customElement('dynamic-trajectory') -export default class DynamicTrajectory extends AbstractDynamicProperty { - static styles = css`${unsafeCSS(style_less)}` - @query('#observation') declare observationSelector: HTMLSelectElement - @property() declare property: IExistsTrajectoryDynamicProperty - @property() observations: IObservationSet[] = [] - - datasetChanged (event: Event): void { - const datasetId = (event.target as HTMLSelectElement).value - this.updateProperty({ - ...this.property, - dataset: datasetId - }) - } - - render (): TemplateResult { - return html` -
-
- - -
-
-
- - -
-
-
-
- ` - } -} diff --git a/src/html/component/properties-editor/properties-editor.ts b/src/html/component/properties-editor/properties-editor.ts index 6f11779..9125881 100644 --- a/src/html/component/properties-editor/properties-editor.ts +++ b/src/html/component/properties-editor/properties-editor.ts @@ -4,11 +4,8 @@ import style_less from './properties-editor.less?inline' import { map } from 'lit/directives/map.js' import './abstract-property/abstract-property' import './dynamic/dynamic-attractor-count/dynamic-attractor-count' -import './dynamic/dynamic-fixed-point/dynamic-fixed-point' import './dynamic/dynamic-generic/dynamic-generic' -import './dynamic/dynamic-has-attractor/dynamic-has-attractor' -import './dynamic/dynamic-trajectory/dynamic-trajectory' -import './dynamic/dynamic-trap-space/dynamic-trap-space' +import './dynamic/dynamic-obs-selection/dynamic-obs-selection' import './static/static-generic/static-generic' import './static/static-input-essential/static-input-essential' import './static/static-input-essential-condition/static-input-essential-condition' @@ -368,34 +365,19 @@ export default class PropertiesEditor extends LitElement { ${map(this.contentData.dynamicProperties, (prop, index) => { switch (prop.variant) { case DynamicPropertyType.FixedPoint: - return html` - - ` + case DynamicPropertyType.HasAttractor: case DynamicPropertyType.TrapSpace: - return html` - - ` case DynamicPropertyType.ExistsTrajectory: return html` - - ` + + ` case DynamicPropertyType.AttractorCount: return html` ` - case DynamicPropertyType.HasAttractor: - return html` - - ` case DynamicPropertyType.Generic: return html`
-
+
${this.getEssentialitySymbol()} - ${map(this.getSecondSelectorItems(), (item) => html` diff --git a/src/html/component/properties-editor/static/static-input-essential/static-input-essential.ts b/src/html/component/properties-editor/static/static-input-essential/static-input-essential.ts index 7bcd98e..7774daa 100644 --- a/src/html/component/properties-editor/static/static-input-essential/static-input-essential.ts +++ b/src/html/component/properties-editor/static/static-input-essential/static-input-essential.ts @@ -1,14 +1,8 @@ import { css, html, type TemplateResult, unsafeCSS } from 'lit' import { customElement, property } from 'lit/decorators.js' import style_less from './static-input-essential.less?inline' -import { - Essentiality, - type IFunctionInputEssentialStaticProperty, - StaticPropertyType -} from '../../../../util/data-interfaces' +import { Essentiality, type IFunctionInputEssentialStaticProperty } from '../../../../util/data-interfaces' import { getEssentialityText, getNextEssentiality } from '../../../../util/utilities' -import { when } from 'lit/directives/when.js' -import { choose } from 'lit/directives/choose.js' import StaticDynamicProperty from '../static-dynamic-property' @customElement('static-input-essential') @@ -38,27 +32,12 @@ export default class StaticInputEssential extends StaticDynamicProperty { }) } - conditionChanged (context: string): void { - this.updateProperty({ - ...this.property, - context - }) - } - render (): TemplateResult { return html`
- ${choose(this.property.variant, [ - [StaticPropertyType.FunctionInputEssential, () => html` -
- -
`], - [StaticPropertyType.FunctionInputEssentialWithCondition, () => html` -
- -
`] - ])} +
+ +
@@ -76,16 +55,6 @@ export default class StaticInputEssential extends StaticDynamicProperty { )
- ${when(this.property.variant === StaticPropertyType.FunctionInputEssentialWithCondition, - () => html` -
- -
- -
-
` - )}

diff --git a/src/html/component/properties-editor/static/static-input-monotonic-condition/static-input-monotonic-condition.less b/src/html/component/properties-editor/static/static-input-monotonic-condition/static-input-monotonic-condition.less index 96536e1..f52d7ff 100644 --- a/src/html/component/properties-editor/static/static-input-monotonic-condition/static-input-monotonic-condition.less +++ b/src/html/component/properties-editor/static/static-input-monotonic-condition/static-input-monotonic-condition.less @@ -41,6 +41,9 @@ .uk-flex-row; .uk-flex-center; .uk-flex-middle; +} + +.gap { gap: 1em; } diff --git a/src/html/component/properties-editor/static/static-input-monotonic-condition/static-input-monotonic-condition.ts b/src/html/component/properties-editor/static/static-input-monotonic-condition/static-input-monotonic-condition.ts index 09dc781..5b5dd59 100644 --- a/src/html/component/properties-editor/static/static-input-monotonic-condition/static-input-monotonic-condition.ts +++ b/src/html/component/properties-editor/static/static-input-monotonic-condition/static-input-monotonic-condition.ts @@ -57,7 +57,8 @@ export default class StaticInputMonotonicCondition extends StaticDynamicProperty } firstChanged (event: Event): void { - const value = (event.target as HTMLSelectElement).value + let value: string | undefined = (event.target as HTMLSelectElement).value + value = value === '' ? undefined : value console.log(value) if (this.property.variant === StaticPropertyType.FunctionInputMonotonicWithCondition) { this.updateProperty({ @@ -76,7 +77,8 @@ export default class StaticInputMonotonicCondition extends StaticDynamicProperty } secondChanged (event: Event): void { - const value = (event.target as HTMLSelectElement).value + let value: string | undefined = (event.target as HTMLSelectElement).value + value = value === '' ? undefined : value if (this.property.variant === StaticPropertyType.FunctionInputMonotonicWithCondition) { this.updateProperty({ ...this.property, @@ -122,7 +124,7 @@ export default class StaticInputMonotonicCondition extends StaticDynamicProperty
-
+
${this.getMonotonicitySymbol()} - + ${map(this.getSecondSelectorItems(), (item) => html` `)} diff --git a/src/html/component/properties-editor/static/static-input-monotonic/static-input-monotonic.ts b/src/html/component/properties-editor/static/static-input-monotonic/static-input-monotonic.ts index 083f7c0..c54b795 100644 --- a/src/html/component/properties-editor/static/static-input-monotonic/static-input-monotonic.ts +++ b/src/html/component/properties-editor/static/static-input-monotonic/static-input-monotonic.ts @@ -7,8 +7,6 @@ import { StaticPropertyType } from '../../../../util/data-interfaces' import { getMonotonicityClass, getNextMonotonicity } from '../../../../util/utilities' -import { when } from 'lit/directives/when.js' -import { choose } from 'lit/directives/choose.js' import StaticDynamicProperty from '../static-dynamic-property' @customElement('static-input-monotonic') @@ -17,7 +15,8 @@ export default class StaticInputMonotonic extends StaticDynamicProperty { @property() declare property: IFunctionInputMonotonicStaticProperty toggleMonotonicity (): void { - let value = getNextMonotonicity(this.property.value) + if (this.property.variant === StaticPropertyType.FunctionInputEssential) return + let value = getNextMonotonicity((this.property).value) if (value === Monotonicity.UNSPECIFIED) { value = getNextMonotonicity(value) } @@ -27,13 +26,6 @@ export default class StaticInputMonotonic extends StaticDynamicProperty { }) } - conditionChanged (context: string): void { - this.updateProperty({ - ...this.property, - context - }) - } - private getMonotonicitySymbol (): string { switch (this.property.value) { case Monotonicity.ACTIVATION: @@ -50,17 +42,9 @@ export default class StaticInputMonotonic extends StaticDynamicProperty { render (): TemplateResult { return html`
- ${choose(this.property.variant, [ - [StaticPropertyType.FunctionInputMonotonic, () => html` -
- -
`], - [StaticPropertyType.FunctionInputMonotonicWithCondition, () => html` -
- -
`] - ])} +
+ +
${this.property.input}
@@ -77,17 +61,6 @@ export default class StaticInputMonotonic extends StaticDynamicProperty { )
- ${when(this.property.variant === StaticPropertyType.FunctionInputMonotonicWithCondition, - () => html` -
- -
- - -
-
` - )}

diff --git a/src/html/util/data-interfaces.ts b/src/html/util/data-interfaces.ts index d188639..6fa94a7 100644 --- a/src/html/util/data-interfaces.ts +++ b/src/html/util/data-interfaces.ts @@ -102,19 +102,19 @@ export interface IProperty { } export interface IFixedPointDynamicProperty extends IProperty { - dataset: string - observation: string + dataset: string | undefined + observation: string | undefined } export interface ITrapSpaceDynamicProperty extends IProperty { - dataset: string - observation: string + dataset: string | undefined + observation: string | undefined minimal: boolean nonpercolable: boolean } export interface IExistsTrajectoryDynamicProperty extends IProperty { - dataset: string + dataset: string | undefined } export interface IAttractorCountDynamicProperty extends IProperty { @@ -123,8 +123,8 @@ export interface IAttractorCountDynamicProperty extends IProperty { } export interface IHasAttractorDynamicProperty extends IProperty { - dataset: string - observation: string + dataset: string | undefined + observation: string | undefined } export interface IGenericDynamicProperty extends IProperty {