Need markIndexes parameter for chart.select() methods

How it is possible to select a specific mark on a chart? I think you planed this because I see some references in the documentation:

    /**
     * Select the given [Datum]s.
     *
     * @param data A [Collection] of [Datum] to highlight on screen.
     * @param selectionMarkIndexes A list of mark indexes used to restrict selection only for these marks
     *  (default to emptyList).
     */
    @Suppress("INAPPLICABLE_JVM_NAME")
    @JvmName("selectData")
    public fun select(data: Collection<Datum<DOMAIN>>)

Here you refer to a selectionMarkIndexes parameter that actually does not exist.

You are right, this has been deprecated (a bit in a hurry) because you now have the SelectedDatum class which contains the Datum, the series index and the mark index.

You get SelectedDatum(s) from pretty much any event now by accessing EventContext.selectedData.

Please don’t hesitate to ask for more info or a code sample if needed.

There is no select() method that accepts a SelectedDatum parameter. So how to select programmatically an element with a specific mark index?

I think you can use either:

    /**
     * Select the given DOMAIN objects for the given [Mark]s indexes.
     *
     * @param domains A [Map] of [DOMAIN] to select on-screen.
     */
    public fun selectFor(domainsPerMark: Map<Int,Collection<DOMAIN>>)

where you use a Map where the key is the mark index and the Collection the DOMAIN you want to select.

Or:

    /**
     * Select the given [SelectedDatum]s.
     *
     * @param selectedData A [Collection] of [SelectedDatum] to select on-screen.
     */
    public fun selectFor(selectedData: Collection<SelectedDatum<DOMAIN>>)

Where you can use the SelectedDatum (for example when you get them from another chart / event).


I hope this helps.

(We really need to update the documentation)