unitrongroup-ir commented on issue #21780:
URL: https://github.com/apache/echarts/issues/21780#issuecomment-6051387292
@adityamukesh thanks for offering to take this. A few notes from the
requester's side, in case they help the design:
- **The result of the layout.** The value should be what
`grid.coordinateSystem.getRect()` holds after the layout, so `containLabel` and
`outerBoundsMode` are included. The configured `grid` option
(`getOption().grid`) is not enough, which is the whole reason for the request.
- **Cheap to call.** We read it on every mouse move to place an HTML
overlay, so please no deep clone as `getOption()` does. Four numbers are enough.
- **A plain value, not the internal object.** The private path returns the
grid's own `BoundingRect` (with a `margin` field), which a caller can modify. A
fresh `{ x, y, width, height }` per call is fine.
- **Finder like the existing APIs.** `{ gridIndex }` / `{ gridId }` as in
`containPixel` and `convertToPixel` looks right to us, and `null` when there is
no such grid or it is not laid out yet.
A way to test it without a browser: ECharts renders in Node with
`echarts.init(null, null, { renderer: 'svg', ssr: true, width: 800, height: 400
})`. With a fixed axis range, the rectangle can be checked against
`convertToPixel` of the axis minimum and maximum (they sit on the left and
right edges), also after a `dataZoom` and with `containLabel: true`. We use
exactly that to guard our own use of the private path against upgrades (checked
with 6.1.0).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]