Opened 5 years ago

Closed 4 years ago

Last modified 4 years ago

#997 closed New feature (fixed)

Change data fetch for OFC2 widgets

Reported by: vipsoft Owned by: vipsoft
Priority: normal Milestone: Piwik 0.5
Component: Core Keywords:
Cc: Sensitive: no

Description

Currently, we pass a URL (data parameter) to the OFC2 charts pointing to a data feed.

Proposal:

  • use AJAX to retrieve the data and then pass the data to the Flash object via its load() method

Benefits:

  • increase browser responsiveness when changing date or site; some users report the browser stalls while loading data
  • better handle an invalid session, e.g., where user no longer logged in; see #975
  • decouples data feed retrieval from the flash object; potentially allows for non-flash, client-side charts to re-use the ofc data feed
  • could be extended to make a single request to the server for all the data feeds on that page

Attachments (1)

997.patch (12.7 KB) - added by vipsoft 4 years ago.
updated patch

Download all attachments as: .zip

Change History (8)

comment:1 Changed 5 years ago by matt (mattab)

I would even suggest that, instead of using an ajax request, we could directly load the graph JSON data in the HTML calling the flash, and set this data to the graph object. This means that, to show the graph, you would just need one http request to request widget+graph data, + one request to fetch the SWF file if not already in cache.

comment:2 Changed 4 years ago by vipsoft (robocoder)

  • Milestone changed from Features requests - after Piwik 1.0 to 2 - Piwik 0.6

comment:3 Changed 4 years ago by vipsoft (robocoder)

In [1541], refs #997 - set content-type to application/json for OFC data feed

comment:4 Changed 4 years ago by vipsoft (robocoder)

ToDo:

  • fix Widgetize (needs the data URL for embedding OBJECTs)
  • replace sendHttpRequest() with ... ???

comment:5 Changed 4 years ago by vipsoft (robocoder)

  • Owner set to vipsoft

Changed 4 years ago by vipsoft (robocoder)

updated patch

comment:6 Changed 4 years ago by vipsoft (robocoder)

  • Resolution set to fixed
  • Status changed from new to closed

In [1543]:

  • fixes #997 - change data fetch for OFC2 widgets to load widget+data in a single fetch; moved HTML to graph.tpl; move JavaScript to common.js; fixed browser portability bug in findSWFGraph
  • fixes #1020 - only the last chart added to the dashboard can be saved locally (using the right-click pop-up menu to "Save Image Locally"); the footer icon link worked properly
  • fixes #947 - truncated translation string in Flash widget when "no data"; this is now styled consistently with "no data" for tables and tag clouds

related changes:

  • data-file (Flash parameter) renamed to x-data-file; this is used by Widgetize to provide the code to embed Flash OBJECTs
  • add translation strings for Flash detection
  • move some translation strings to JavaScript and enhance getJavascriptTranslations() to always generate 'General' translation strings

comment:7 Changed 4 years ago by vipsoft (robocoder)

In [1575], refs #997 - reorder params slightly

In [1574], refs #997 - add config option; allow users to revert to previous behavior

Note: See TracTickets for help on using tickets.