Skip to content

Title/image special handling shouldn't be on by default (or at least should be documented and have a way to disable) #694

@kanitw

Description

@kanitw

The following blocks in https://github.com/vega/vega-tooltip/blob/next/src/formatValue.ts#L19-25 seems pretty problematic for me

    if (title) {
      content += `<h2>${valueToHtml(title)}</h2>`;
    }

    if (image) {
      content += `<img src="${valueToHtml(image)}">`;
    }

doesn't seem to be documented and may cause unintended effect.

For example, if there is a field in the data source called title, it will automatically becomes "title" in the output even though users may not intend to do so.

image

spec -->

(Note: I need to add calculate to simulate that there is a field "title" in the example.)

I don't think we should do this by default since it will surprise people more.

cc: @domoritz @nyurik (You might have an idea why we had this block.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions