10.5.0 to 10.6.0
Version 10.6.0 changes both library files and sample template markup. If you customized a sample template from an earlier release, compare it with the same-named 10.6.0 template and apply the changes below.
Workspace Is Now an Optional Plugin
Workspace is no longer part of the core library. It is now the workspace plugin, located in chartiq/plugins/workspace. If you do not use Workspaces, you do not need to include it.
If you use Workspaces:
-
Import the plugin in your template, before the chart is created:
import "./plugins/workspace/index.js"; // @@ WORKSPACE -
Remove the Workspace controls from your template markup. The plugin now adds them to the chart's
.ciq-menu-section .ciq-dropdownselement. These two elements were removed from the 10.6.0 templates:<cq-toggle class="ciq-workspace-save" reader="Save Workspace" tooltip="Save Workspace" icon="cloud"></cq-toggle> <cq-menu class="nav-dropdown toggle-options ciq-workspaces alignright" reader="Workspaces" config="workspaces" responsive tooltip="Workspaces"></cq-menu> -
Move your Workspace configuration from
config.menuWorkspaceConfigtoconfig.plugins.workspace:// Before (10.5.0) config.menuWorkspaceConfig.loadSample = true; config.menuWorkspaceConfig.loadWorkspaceId = "ws_995669dc-1048-44b5-9267-b0a6967e4316"; // After (10.6.0) config.plugins.workspace.loadSample = true; config.plugins.workspace.loadWorkspaceId = "ws_995669dc-1048-44b5-9267-b0a6967e4316";The
nameValueStoreandcboptions moved the same way.
Webpack and Tree-Shaken Builds
In your importActivation.js, remove the following entries from CIQ.activateImports(). They no longer exist in the core library:
Note: These imports were only required in v10.5.0.
Standard.workspacesComponents.workspaceEditDialogComponents.workspaceNewDialogComponents.workspacesMenu
To keep Workspaces, import the plugin in your entry file:
import "chartiq/plugins/workspace/index";
Migrating Saved Workspaces
Applies if your users saved Workspaces in 10.5.0.
The format of saved Workspace data changed from schema version 1.0.0 to 2.0.0. In 10.5.0, all workspaces were stored together in a single stx-workspaces record. In 10.6.0, each workspace is stored in its own stx-workspaces/{id} record, and the stx-workspaces key returns only workspace metadata.
The Workspace plugin does not migrate 1.0.0 data automatically. Existing workspaces will not load until you convert them. Run the migration once, before the Workspace plugin initializes.
To migrate:
- Read the legacy
stx-workspacescollection from your workspace store. - Convert it to individual records with the following function. Each returned record uses schema version
2.0.0. - Save each returned record under
stx-workspaces/{id}. - Remove the legacy
stx-workspacescollection.
// Converts a 1.0.0 collection into individual 2.0.0 records.
function migrateWorkspaces(legacy) {
if (
legacy?.schemaVersion !== "1.0.0" ||
!legacy.workspaces ||
typeof legacy.workspaces !== "object" ||
Array.isArray(legacy.workspaces)
) {
throw new Error("Invalid v1 workspace collection");
}
return Object.entries(legacy.workspaces).map(([id, record]) => {
return { ...structuredClone(record), id, schemaVersion: "2.0.0" };
});
}
For more information, see the Legacy workspace migration section of the Workspace plugin README, chartiq/plugins/workspace/README.md.
Custom Storage
If you provide your own config.plugins.workspace.nameValueStore (for example, one that saves to a server), migrate your stored data to the new format and update your store so it supports the following reads. set and remove write and delete the same record by ID.
get("stx-workspaces", cb, metadataKeys)requests the workspace list, for exampleGET /stx-workspaces?metadataKeys=name,isAdmin,isFavorite,createdAt,modifiedAt. Return only the requested fields, keyed by workspace ID, or{}when there are none.get("stx-workspaces/{id}", cb)requests one workspace, for exampleGET /stx-workspaces/ws1. Return the complete saved record, ornullif it does not exist.
See CIQ.Workspaces#initialize for example responses.
NameValueStoreLarge Requires a Store Name
In 10.5.0, CIQ.NameValueStoreLarge defaulted storeName to "chartiqworkspaces". In 10.6.0, storeName is required, and the constructor throws an error if it is missing. If you create the store yourself, pass a name:
// Before (10.5.0)
const store = new CIQ.NameValueStoreLarge();
// After (10.6.0)
const store = new CIQ.NameValueStoreLarge({ storeName: "chartiqworkspaces" });
The Workspace plugin supplies the name itself, so no change is needed when you pass CIQ.NameValueStoreLarge as the plugin's nameValueStore.
Low Frequency Plugin No Longer Required for Labels
The labels parameter of CIQ.ChartEngine#addSeries is now part of the standard package. If you import ./plugins/lowfrequency/index.js only to display labels, for example on histograms, you can remove that import.
Label Tooltip Add-On
Truncated legend labels now display their full text on hover. This is provided by the new labelTooltip add-on, which is enabled by default.
If you use a webpack or tree-shaken build with your own importActivation.js, add the add-on to CIQ.activateImports():
CIQ.activateImports(
// ...
AddOns.labelTooltip,
// ...
);
To disable the add-on:
config.addOns.labelTooltip.enabled = false;
Series/Event Loading Toast
A loading toast notification is now shown by default while series or events are being added to the chart. To disable it globally, set showSeriesLoader to false:
stxx.preferences.showSeriesLoader = false;
