-
Notifications
You must be signed in to change notification settings - Fork 787
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[@card] Realtime cards (2/N) #1551
Conversation
9a27a2b
to
eba36be
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Changes are optional and purely cosmetic. Really nice job @valayDave .
@@ -18,6 +18,7 @@ | |||
<body> | |||
<div class="card_app"></div> | |||
<script> | |||
var METAFLOW_RELOAD_TOKEN = "[METAFLOW_RELOAD_TOKEN]" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
total nit, but we use let/const these days to be more explicit on if the value is immutable.
); | ||
|
||
export let componentData: types.BarChartComponent; | ||
const { config, data, labels } = componentData; | ||
$: ({ config, data, labels } = componentData); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fun sidenote, svelte just announced they're changing this api for the same confusion we got caught up in here. Glad its fixed for now.
@@ -0,0 +1,14 @@ | |||
<!-- A simple text component to render a paragraph wherever needed.App |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comment should be updated, totally my fault.
/** | ||
* This function is used to update the cardData object from the window. | ||
* It is used to update the cardData object with | ||
* changes that have come from the parent window. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you're updating comments, probably helpful here to call out that we're intentionally assigning it to the window object as well.
Not reviewing this one :). I'll assume it works :). |
befd689
to
cfb7bbf
Compare
eba36be
to
4bb9032
Compare
21d21fb
to
fd1502d
Compare
4bb9032
to
e5e870f
Compare
fd1502d
to
a1c154d
Compare
e5e870f
to
d5f8c75
Compare
a1c154d
to
6890054
Compare
d5f8c75
to
fa23ad4
Compare
6890054
to
ec58dd0
Compare
fa23ad4
to
272346a
Compare
ec58dd0
to
83d7347
Compare
272346a
to
57e3a7e
Compare
087fe3e
to
2a8501a
Compare
993d6f0
to
a719a43
Compare
2a8501a
to
be176e3
Compare
The base branch was changed.
be176e3
to
78c7154
Compare
615ffe4
to
947c2ec
Compare
As mentioned -- am fine with this (didn't review). My only comment is somewhat orthogonal (I think I had mentioned before): it would be nice to remove things that are actually not packaged with Metaflow to outside the |
- cleanup the ui component code and add naive progress-bar
- Chart support within tables and anywhere across the page - Chart mutation done based on spec/data changes.
- pass down options in vega chart - progress-bar min width for mf UI - Fix bug when vega-chart spec changes. - fix `embed` class CSS
* [card-components] internal MetaflowCard classes support realtime behavior - Markdown and Artifact Component made realtime. - default/blank cards made realtime - default component ids to realtime-updatable UserComponents * [default-card-python] add runtime check - Add a variable in the HTML template to enable/disable `metaflow_card_update` function * [card-components] progressbar / vegacharts * [card-components] customize updates for Tables/Images - Set options that allows disabling realtime updates for components that may have lots of data like `Image` / `Table`. This can be useful when we are calling refresh often and don't want to update data which maybe static. * [card-components] address comments on Image class - Image.update supports multi-type object - remove `disable_updates` from public api * [card-components][vega-chart][bug-fix] - property in vega chart to show controls - remove `data` argument from Vega Chart. - It only takes `spec` as an argument. - VegaChart default width set to `container` * [@card] Realtime cards (4/N) (#1553) * [card-server] cli command to expose a card server - Server helps view realtime updates - Added a card viewer html file - Created a simple HTTP based card server that will help showcase the realtime cards from querying the server - The API response contains the task status for the data api - reload on run change : A background thread checks if there are new runs created via the latest_run file. - pass down poll_interval to card viewer - card server is also resiliant to no runs - You can set `METAFLOW_DEBUG_CARD_SERVER` to debug card server logs, Logging is off by default - clean url parsing for requests : needed to ensure calls to card server are resiliant to query params in requests. - also need clean url parsing for setting `embed` query param in the card iframe - run-info API sends task finished information which is useful when switching cards automatically when new tasks start. - it Always logs when run-ids change * [card-viewer-html] UI + Structure - Cleanup HTML template - Handles edge case where no runs are available - Shows errors when things are not working - leverages a configurable poll interval - set `embed` query param in the card iframe source. - it automatically switches to new card when tasks finish and other tasks are running. - Fix bug when card data is not available - checks for `final` reload token to stop polling updates * [@card] [card-core] always call `refresh` after first `render_runtime` (5/N) (#1670) * [card-core] always call `refresh` after first `render_runtime` - Added a `sync` argument to the card creator [@card][bug fixes] Address comments and squashing bugs (6/N) (#1678) * [card-components] type-hints + doc string Fix. * [card-core] fix function signature in tests. * [card-server] address comments on debug mode and hygiene * [card-components] vega charts special case inside table --------- Co-authored-by: adam <[email protected]> --------- Co-authored-by: adam <[email protected]>
fc430d4
to
623cd86
Compare
* Setup a new card and start the watcher | ||
*/ | ||
function handleLoadCard(name, value) { | ||
document.getElementsByTagName("title").innerHTML = name; |
Check warning
Code scanning / CodeQL
DOM text reinterpreted as HTML Medium
DOM text
function handleLoadCard(name, value) { | ||
document.getElementsByTagName("title").innerHTML = name; | ||
const iframe = document.getElementById("card-frame"); | ||
iframe.src = `/card/${value}?embed=true`; |
Check warning
Code scanning / CodeQL
DOM text reinterpreted as HTML Medium
DOM text
* [default-card][ui] default card realtime updatable - cleanup the ui component code and add naive progress-bar * [default-card][ui] Add custom progress bar * [default-card][ui] vegachart component - Chart support within tables and anywhere across the page - Chart mutation done based on spec/data changes. * [default-card][ui] remove chart.js deps. * [default-card][ui] migrate to vite * [default-card][ui] update progress bar styles * [default-card][ui] Fixes to chart/css/progess bar - pass down options in vega chart - progress-bar min width for mf UI - Fix bug when vega-chart spec changes. - fix `embed` class CSS * [@card] Realtime cards (3/N) (Netflix#1552) * [card-components] internal MetaflowCard classes support realtime behavior - Markdown and Artifact Component made realtime. - default/blank cards made realtime - default component ids to realtime-updatable UserComponents * [default-card-python] add runtime check - Add a variable in the HTML template to enable/disable `metaflow_card_update` function * [card-components] progressbar / vegacharts * [card-components] customize updates for Tables/Images - Set options that allows disabling realtime updates for components that may have lots of data like `Image` / `Table`. This can be useful when we are calling refresh often and don't want to update data which maybe static. * [card-components] address comments on Image class - Image.update supports multi-type object - remove `disable_updates` from public api * [card-components][vega-chart][bug-fix] - property in vega chart to show controls - remove `data` argument from Vega Chart. - It only takes `spec` as an argument. - VegaChart default width set to `container` * [@card] Realtime cards (4/N) (Netflix#1553) * [card-server] cli command to expose a card server - Server helps view realtime updates - Added a card viewer html file - Created a simple HTTP based card server that will help showcase the realtime cards from querying the server - The API response contains the task status for the data api - reload on run change : A background thread checks if there are new runs created via the latest_run file. - pass down poll_interval to card viewer - card server is also resiliant to no runs - You can set `METAFLOW_DEBUG_CARD_SERVER` to debug card server logs, Logging is off by default - clean url parsing for requests : needed to ensure calls to card server are resiliant to query params in requests. - also need clean url parsing for setting `embed` query param in the card iframe - run-info API sends task finished information which is useful when switching cards automatically when new tasks start. - it Always logs when run-ids change * [card-viewer-html] UI + Structure - Cleanup HTML template - Handles edge case where no runs are available - Shows errors when things are not working - leverages a configurable poll interval - set `embed` query param in the card iframe source. - it automatically switches to new card when tasks finish and other tasks are running. - Fix bug when card data is not available - checks for `final` reload token to stop polling updates * [@card] [card-core] always call `refresh` after first `render_runtime` (5/N) (Netflix#1670) * [card-core] always call `refresh` after first `render_runtime` - Added a `sync` argument to the card creator [@card][bug fixes] Address comments and squashing bugs (6/N) (Netflix#1678) * [card-components] type-hints + doc string Fix. * [card-core] fix function signature in tests. * [card-server] address comments on debug mode and hygiene * [card-components] vega charts special case inside table --------- Co-authored-by: adam <[email protected]> --------- Co-authored-by: adam <[email protected]> --------- Co-authored-by: adam <[email protected]>
* [default-card][ui] default card realtime updatable - cleanup the ui component code and add naive progress-bar * [default-card][ui] Add custom progress bar * [default-card][ui] vegachart component - Chart support within tables and anywhere across the page - Chart mutation done based on spec/data changes. * [default-card][ui] remove chart.js deps. * [default-card][ui] migrate to vite * [default-card][ui] update progress bar styles * [default-card][ui] Fixes to chart/css/progess bar - pass down options in vega chart - progress-bar min width for mf UI - Fix bug when vega-chart spec changes. - fix `embed` class CSS * [@card] Realtime cards (3/N) (Netflix#1552) * [card-components] internal MetaflowCard classes support realtime behavior - Markdown and Artifact Component made realtime. - default/blank cards made realtime - default component ids to realtime-updatable UserComponents * [default-card-python] add runtime check - Add a variable in the HTML template to enable/disable `metaflow_card_update` function * [card-components] progressbar / vegacharts * [card-components] customize updates for Tables/Images - Set options that allows disabling realtime updates for components that may have lots of data like `Image` / `Table`. This can be useful when we are calling refresh often and don't want to update data which maybe static. * [card-components] address comments on Image class - Image.update supports multi-type object - remove `disable_updates` from public api * [card-components][vega-chart][bug-fix] - property in vega chart to show controls - remove `data` argument from Vega Chart. - It only takes `spec` as an argument. - VegaChart default width set to `container` * [@card] Realtime cards (4/N) (Netflix#1553) * [card-server] cli command to expose a card server - Server helps view realtime updates - Added a card viewer html file - Created a simple HTTP based card server that will help showcase the realtime cards from querying the server - The API response contains the task status for the data api - reload on run change : A background thread checks if there are new runs created via the latest_run file. - pass down poll_interval to card viewer - card server is also resiliant to no runs - You can set `METAFLOW_DEBUG_CARD_SERVER` to debug card server logs, Logging is off by default - clean url parsing for requests : needed to ensure calls to card server are resiliant to query params in requests. - also need clean url parsing for setting `embed` query param in the card iframe - run-info API sends task finished information which is useful when switching cards automatically when new tasks start. - it Always logs when run-ids change * [card-viewer-html] UI + Structure - Cleanup HTML template - Handles edge case where no runs are available - Shows errors when things are not working - leverages a configurable poll interval - set `embed` query param in the card iframe source. - it automatically switches to new card when tasks finish and other tasks are running. - Fix bug when card data is not available - checks for `final` reload token to stop polling updates * [@card] [card-core] always call `refresh` after first `render_runtime` (5/N) (Netflix#1670) * [card-core] always call `refresh` after first `render_runtime` - Added a `sync` argument to the card creator [@card][bug fixes] Address comments and squashing bugs (6/N) (Netflix#1678) * [card-components] type-hints + doc string Fix. * [card-core] fix function signature in tests. * [card-server] address comments on debug mode and hygiene * [card-components] vega charts special case inside table --------- Co-authored-by: adam <[email protected]> --------- Co-authored-by: adam <[email protected]> --------- Co-authored-by: adam <[email protected]>
[card-ui] default card real-time updatable