29 Jan 2019 |
Brylie Christopher Oxley | So, how would we tell the charts that the chart settings have changed, with the above guidelines? | 07:27:52 |
Brylie Christopher Oxley | In reply to @brylie:matrix.org
In this specific case, we have something like:
- Home Profile
- Activities
- Chart Settings
- ChartA
- ChartB
- ChartC
This should be
- Home Profile
- Activities
- Chart Settings
- ChartA
- ...
| 07:30:04 |
Daria Voytova | Any difficulties yesterday? yes... Not so easy using Ploty.js documentation cuz it shows only parts of information and if I want something specific then I don't know how to get that information 🤷🏼 | 07:31:53 |
Brylie Christopher Oxley | Jep, I noticed that too. | 07:32:37 |
Daria Voytova | Sometimes I was learning their source code to understood why chart had width 700px and it was more than parent container had 🤦🏼 | 07:32:48 |
Daria Voytova | source code of Ploty.js | 07:33:02 |
Daria Voytova | In this specific case, we have something like: Why Chart settings has the same layer as chart? I think it should be higher | 07:33:40 |
Daria Voytova | Redacted or Malformed Event | 07:33:58 |
Brylie Christopher Oxley | That is fine. | 07:34:59 |
Daria Voytova | Activities
Settings
Chart 1
Chart 2
Chart 3 | 07:35:13 |
Daria Voytova | Or Settings is not global and not every chart should be updated if settings is? | 07:35:35 |
Brylie Christopher Oxley | So the Chart Container displays the settings widgets and passes their state directly to the chart components? | 07:36:14 |
Daria Voytova | Indeed | 07:36:53 |
Daria Voytova | or, as not meteor way, add listiner to changing value of HTML element | 07:37:23 |
Brylie Christopher Oxley | Yes, and what happens in the listener? | 07:39:29 |
Brylie Christopher Oxley | All charts should reflect same time period and metric. | 07:40:23 |
Brylie Christopher Oxley | So, should react to state changes in Chart Settings component. | 07:41:05 |
Brylie Christopher Oxley | And in which component do we define the listener? | 07:42:29 |
Brylie Christopher Oxley | In reply to @brylie:matrix.org
Two things I just remembered about the software architecture here:
- we are building a tree of components
- in that tree, events propagate up and data passes down
Remember these guidelines. | 07:47:20 |
Daria Voytova | I see two scenarios 1) The structure is - Activities - Settings (Chart container) - Chart 1 - Chart 2 ...
In this case Chart container has widget and looks at changing of this widget. When changes happen then passes the value directly to the chart components. The structure is tree and data passes down
2) The structure is
Activities - Settings - Chart 1...
In this case every chart component looks at changing of widget. Structure is tree but data is not passes down | 07:50:17 |
Daria Voytova | urgx | 07:50:47 |
Daria Voytova | 1) structure is
Activites
Settings
Chart 1
Chart 2
.. | 07:51:13 |
Daria Voytova | I prefer the first point | 07:51:51 |
Brylie Christopher Oxley | Ok, in the first case, the event can propagate up to the Activities container, and the value would be passed down to the charts. | 07:53:37 |
Brylie Christopher Oxley | I.e. the event listener can be defined in the Activity component to catch events from the child components. In that case, the Chart Settings would just be HTML. | 07:55:03 |
Daria Voytova | well.. | 07:58:51 |
Brylie Christopher Oxley | The settings are sibling to the charts, and state can be managed by parent. | 07:59:24 |
Daria Voytova | yes, yes | 07:59:34 |
Daria Voytova | I got it | 07:59:36 |
Daria Voytova | forget about me long speech :D | 07:59:48 |