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
AG-11450 - More new DOM structure fixes. #1569
Conversation
… managed DOM, rather than in users DOM.
…erlays in fixed size chart options case.
260baa6
to
6ee5c4f
Compare
@@ -172,12 +172,10 @@ export abstract class Chart extends Observable implements AgChartInstance { | |||
newValue(value: HTMLElement) { | |||
if (this.destroyed) return; | |||
|
|||
value.setAttribute('data-ag-charts', ''); |
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.
We use this for the dark mode logic (plugins/ag-charts-generate-example-files/src/executors/generate/generator/utils/getDarkModeSnippet.ts)
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.
Yes, I've moved this onto the part of the DOM we actually manage and updated the dark-mode logic.
right: 0; | ||
.ag-charts-canvas-overlay { | ||
position: relative; | ||
display: contents; |
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.
What's display: contents meant to be doing here?
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.
In one iteration it seemed that the <div>
was adding some extra 3px to the canvas size (which caused an infinitely growing canvas feedback loop), this seemed to remove any extra contribution of this element from the impact on the parents size.
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.
The infinite feedback loop happens when you miss display: block
from the canvas - it defaults to inline-block
, which creates extra padding
https://ag-grid.atlassian.net/browse/AG-11450
More refinements of the new DOM:
window
bounds correctly, and are no longer clipped due to removal of redundantoverflow: hidden
in several spots.width
and/orheight
now correctly auto-centers the chart in the container DIV.Example-runner cleanup:
data-ag-charts
onto.ag-charts-wrapper
which we manage.Use-cases tested - configs:
Features tested: