Project

General

Profile

Actions

Bug #4875

closed

Interactive WCartesianChart tooltip regressions: performance and cursor selection

Added by Bruce Toll about 8 years ago. Updated almost 8 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Roel Standaert
Target version:
Start date:
04/23/2016
Due date:
% Done:

0%

Estimated time:

Description

With github wt 3.3.5-25-g2fad170, there appear to be some minor regressions with WCartesianChart tooltips (relative to wt 3.3.5).

While the switch to using server-side tooltip lookups seems to work well and reduces initial cpu and data transfer, I believe the update precludes changing cursors over a marker (at least with a pure client-side CSS approach). This was possible with wt-3.3.5, as demonstrated in the attached test program (test_20160422a_tooltip_cpu.C).

The server-side CPU usage can also be rather high in some usage patterns, as seen in the same attached test program (test_20160422a_tooltip_cpu.C). The worst case is when a mouse movement stops on the chart in a location without a marker. On a 2.7GHz i7-2620M, this takes around a half second with a gcc 4.7 debug build. The test case uses a QueryModel with 2000 rows and includes 20 WDateTime columns that are not used in the chart.

Admittedly, the above test is extreme. Reducing the number of unused WDateTime columns and/or using a larger batch size on the query improves performance significantly. A second example (test_20160422b_tooltip_cpu_standard_item_model.C), that uses a more minimal WStandardItemModel is able to check for tooltips much more quickly, although CPU usage is still not negligible.


Files

Actions #1

Updated by Bruce Toll almost 8 years ago

One closely related consideration is the ability to respond to clicks on markers. For instance, in a scatterplot where each marker represents a country, it might be desirable to have a marker with a tooltip that displays the country name and, when clicked, opens a relevant Wikipedia page about the country.

With Wt 3.3.5, it is possible to provide links on markers by calling setLink() on the underlying areas(). However, I don't believe that Wt 3.3.5 provides a straightforward way to correlate a marker with its associated area in the area vector. Still, with 3.3.5, it is easy to have all markers link to a common web page, e.g. a table of countries, and it's possible that a relatively small enhancement could provide support for automatically calling setLink based on a model's LinkRole in an analogous manner to ToolTipRole.

From the documentaiton, it appears that the latest Wt (git version) has many chart enhancements, including optional support for clicks to select entire series (setSeriesSelectionEnabled). Perhaps the new seriesSelected signal could be used to determine whether a click occurred on a marker?

Actions #2

Updated by Koen Deforche almost 8 years ago

  • Status changed from New to InProgress
  • Assignee set to Roel Standaert
Actions #3

Updated by Roel Standaert almost 8 years ago

I've implemented WAbstractChartModel::flags(int row, int column), which allows to use ItemHasDeferredTooltip and ItemIsXHTMLText to determine which method of loading and rendering the tooltips should be used.

It's also now possible to move over an XHTML tooltip and it won't disappear as long as the mouse is over it. This does not quite do what setLink does, but it does allow for links to be put in the XHTML in the tooltip.

Actions #4

Updated by Roel Standaert almost 8 years ago

  • Status changed from InProgress to Implemented @Emweb
Actions #5

Updated by Bruce Toll almost 8 years ago

Thanks! This sounds like a great way to accommodate the various use cases. The recent chart enhancements are really powerful.

Actions #6

Updated by Koen Deforche almost 8 years ago

  • Status changed from Implemented @Emweb to Resolved
Actions #7

Updated by Koen Deforche almost 8 years ago

  • Status changed from Resolved to Closed
  • Target version set to 3.3.6
Actions

Also available in: Atom PDF