Skip to content
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

[Bug] SOLVED the issue caused by hidden 3D axes. #20583

Open
akiastyle opened this issue Dec 12, 2024 · 0 comments
Open

[Bug] SOLVED the issue caused by hidden 3D axes. #20583

akiastyle opened this issue Dec 12, 2024 · 0 comments
Labels
bug en This issue is in English pending We are not sure about whether this is a bug/new feature.

Comments

@akiastyle
Copy link

Version

5.5.1

Link to Minimal Reproduction

https://codepen.io/akiastyle/pen/LEPRddW

Steps to Reproduce

When I create a 3D bar and hide all axes to customize the chart's view and the XY plane, I encounter a large number of errors, which increases the execution time. I am using vanilla JavaScript.

{739CAF4B-42E9-4279-A903-6C7D8173B310}

Current Behavior

I resolved this issue by modifying the code in echarts-gl.min.js. The error was caused by null axis values.
The correction I made is specifically required only in the explained rows, even though similar changes might need to be applied to other rows as well. My activity was limited to the modifications mentioned above.

Expected Behavior

I resolved the issue by changing specific lines in the echarts-gl.min.js code. The problem was caused by null axis values, and I addressed it as follows:

On.prototype = {
constructor: On,
add: function (e) {
return Et.add(this.array, this.array, e.array), this._dirty = !0, this },
set: function (e, t, r, i) {
return this.array[0] = e,
this.array[1] = t,
this.array[2] = r,
this.array[3] = i,
this._dirty = !0, this },
setArray: function (e) {
return
this.array[0] = e?.[0] ?? 0, <---------------------------- this.array[0] = e[0],
this.array[1] = e?.[1] ?? 0, <---------------------------- this.array[1] = e[1],
this.array[2] = e?.[2] ?? 0, <---------------------------- this.array[2] = e[2],
this.array[3] = e?.[3] ?? 0, <---------------------------- this.array[3] = e[3],
this._dirty = !0,
this
},

AND

this._axes.forEach((function(i) {
for (var n = i.axisLineCoords, a = (i.labelsMesh.geometry,
0); a < t.length; a++)
t[a].setArray(n?[a] ?? 0), <---------------------------- t[a].setArray(n[a]),
t[a].w = 1,
t[a].transformMat4(i.rootNode.worldTransform).transformMat4(e.viewMatrix).transformMat4(e.projectionMatrix),
t[a].x /= t[a].w,
t[a].y /= t[a].w;
var o, s, l = t[1].x - t[0].x, h = t[1].y - t[0].y, u = (t[1].x + t[0].x) / 2, c = (t[1].y + t[0].y) / 2;
Math.abs(h / l) < .5 ? (o = "center",
s = c > r.y ? "bottom" : "top") : (s = "middle",
o = u > r.x ? "left" : "right"),
i.setSpriteAlign(o, s, this._api)
}

Environment

- OS: 
- Browser: chrome latest
- Framework: none

Any additional comments?

No response

@akiastyle akiastyle added the bug label Dec 12, 2024
@echarts-bot echarts-bot bot added en This issue is in English pending We are not sure about whether this is a bug/new feature. labels Dec 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug en This issue is in English pending We are not sure about whether this is a bug/new feature.
Projects
None yet
Development

No branches or pull requests

1 participant