Skip to content

[Bug] 布局会在图里筛选掉全部数据项后出现错乱 #4634

Open

Description

@xuefei1313

Version

2.1.4

Link to Minimal Reproduction

https://www.visactor.com/vchart/playground?specId=6568343404&timestamp=1785314595422&version=2.1.4&theme=light

Steps to Reproduce

先调整图表尺寸,然后点击图例

Current Behavior

Image

Expected Behavior

Image

Environment

- OS:
- Browser:
- Framework:

Any additional comments?

No response

Activity

  1. Issues-translate-bot commented on Jul 29, 2026

    @Issues-translate-bot

    Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


    Title: [Bug] The layout will be messed up after filtering out all data items in the graph.

  2. dajiaohuang commented on Aug 24, 2026

    @dajiaohuang
    Contributor

    Thank you for the detailed bug report with comprehensive reproduction steps and measurements.

    The issue appears to be in the animation state management system where interpolated values from the hover animation are committed when updateState() is called during hover, and are never reconciled against the mark's declared idle style.

    I verified:

    • The bug only occurs with instance-level animation: true and animationState.point configured
    • The leak rate scales with the state animation's duration
    • Points that are invisible at rest (size: 0) stay permanently visible after mouse leaves

    I attempted to trace the issue through updateStateOfGraphics and updateStates in interaction.ts, but the fix appears to require deeper changes to how animation states are managed when multiple states are active simultaneously.

    Would you be able to provide guidance on the expected approach:

    1. Should the hover animation be interrupted/cancelled when updateState() is called?
    2. Or should the animation system track and revert interpolated values when the declared idle style differs from the current animated value?
    3. Or is there a simpler approach by ensuring updateState() clears the hover state first before applying the new state?

    This would help determine the minimal fix that addresses the root cause without introducing side effects.

  3. dajiaohuang commented on Oct 22, 2026

    @dajiaohuang
    Contributor

    Correction: my earlier comment here described the separate hover/state-animation report in #4639 and does not diagnose the chart-layout behavior reported in this issue. Please disregard that diagnosis. I have not independently reproduced or identified the root cause of this issue; the original playground and resize-then-click-legend steps remain the report to investigate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions