diff --git a/app/components/entity-chart.js b/app/components/entity-chart.js new file mode 100644 index 0000000..684a8f7 --- /dev/null +++ b/app/components/entity-chart.js @@ -0,0 +1,17 @@ +import Ember from 'ember'; + +export default Ember.Component.extend({ + tagName: 'div', + classNames: ['layout-page'], + + visibleProperty: function() { + var properties = this.get('entity.properties'); + return properties.objectAt(0); + }.property('entity'), + + actions: { + showPropertyValues(_prop) { + this.set('visibleProperty', _prop); + } + } +}); diff --git a/app/controllers/lab-mashup.js b/app/controllers/lab-mashup.js index af3b5dd..f386b6a 100644 --- a/app/controllers/lab-mashup.js +++ b/app/controllers/lab-mashup.js @@ -23,35 +23,5 @@ export default Ember.Controller.extend({ }); return entity; - }.property('model.[]'), - - actions: { - showProperty1Values(property) { - var id = property.id; - - var prop = null; - - this.get('S1Entity').get('properties').forEach(function (proper) { - if (proper.id === id) { - prop = proper; - } - }); - - this.set('S1Property', prop); - }, - - showProperty2Values(property) { - var id = property.id; - - var prop = null; - - this.get('S2Entity').get('properties').forEach(function (proper) { - if (proper.id === id) { - prop = proper; - } - }); - - this.set('S2Property', prop); - } - } + }.property('model.[]') }); diff --git a/app/styles/app.css b/app/styles/app.css index 897e144..e16e5e4 100644 --- a/app/styles/app.css +++ b/app/styles/app.css @@ -87,10 +87,16 @@ h2 { .column-right h3 { text-align: center; + + margin: 0; + padding: 0; } .column-right h4 { text-align: right; + + margin: 0; + padding: 0; } .layout-page { @@ -104,6 +110,10 @@ h2 { height: 100%; } +.layout-page h2 { + margin-bottom: 10px; +} + .line-chart { width: 400px; height: 400px; diff --git a/app/templates/components/entity-chart.hbs b/app/templates/components/entity-chart.hbs new file mode 100644 index 0000000..0892882 --- /dev/null +++ b/app/templates/components/entity-chart.hbs @@ -0,0 +1,25 @@ +
+ {{entityName}}+ |
+ |
---|---|
+ {{property-table model=entity showProperty="showPropertyValues"}} + | +
+ {{#if visibleProperty}}
+ {{visibleProperty.name}}+ {{/if}} + + {{line-chart data=visibleProperty.values}} + + {{#if visibleProperty}} +{{visibleProperty.type}}+ {{/if}} + |
+
-
+ |
- + |
SimulationLorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. | |||
-
-
+ {{entity-chart entity=S1Entity entityName="Transmission System"}}
|
-
-
+ {{entity-chart entity=S2Entity entityName="Distribution System"}}
|