Skip to content

Commit

Permalink
Release v1.20.0
Browse files Browse the repository at this point in the history
  • Loading branch information
compose-sdk-release-bot committed Oct 2, 2024
1 parent 7afd584 commit 1a9f78d
Show file tree
Hide file tree
Showing 405 changed files with 9,332 additions and 2,222 deletions.
3 changes: 3 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ module.exports = {
'@typescript-eslint/no-empty-interface': ['error', { allowSingleExtends: true }],
'max-lines-per-function': ['warn', 400],
'max-lines': ['warn', 1000],
'no-global-assign': 'error',
'no-extend-native': 'error',
'no-implicit-globals': 'error',
},
},
{
Expand Down
31 changes: 29 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,37 @@
# Changelog

## [1.20.0] - 2024-10-01

### Added
- Add `widgetModelTranslator` for translating between a widget model and related component props
- Add `dashboardModelTranslator` for translating between a dashboard model and related component props
- Add hook `useExecutePluginQuery` (alpha) for use in plugin components
- Implement custom context menu and sub-menu for dashboard cross-filtering and drilldown
- Add internal change detection props and hook to coordinate cross filtering and drilldown
- Support drilldown hierarchies (including predefined date hierarchies) for `ChartWidget`, `DrilldownWidget` for internal testing
- Add hook `useGetHierarchyModels` that retrieves existing hierarchy models from Fusion
- Add plugin `highcharts-rounded-corners` for Highcharts (internal charting library)


### Changed
- **Breaking:** Restructure `DashboardProps` for beta release: `widgets` to using `WidgetProps[]`, instead of `WidgetModel[]`, `layout` to `layoutOptions`, `widgetFilterOptions` to `widgetOptions`
- Deprecate `get*Props()` on `WidgetModel` – use utility functions of `widgetModelTranslator` instead
- Move components `DashboardById` and `Dashboard` to beta for React, Angular, and Vue
- Support dashboards of multiple data sources
- Handle Fusion date formats from locale
- Extend data point entries with `displayValue`
- Consolidate interface for custom chart plugins
- Improve fitlers: translation of `doesn't equal` filter, update of `CriteriaFilterTile`, formula in ranked filter
- Replace `fetch-intercept` with an isolated in-house implementation
- Extend CLI `get-data-model` to support perspectives
- Improve charts: "No Results" overlay added to all charts, data options validation for trend or forecast, polar chart stacking and value labels disabling
- Improve pivot tables: container size, additional visual tests

## [1.19.0] - 2024-09-17

### Added
- Support loading of fonts from Fusion
- Support dashboard rendering of text widgets and chart plugins
- Support dashboard rendering of text widgets and chart plugins for internal testing

### Changed
- Fix missing spaces in headings for `MemberFilterTile`, `Table`, and `PivotTable`
Expand Down Expand Up @@ -267,7 +294,7 @@ in hooks `useGetDashboardModel`, `useGetDashboardModels`, `useExecuteQueryByWidg
- Add component `PivotTable` (alpha) for React, Angular, and Vue

### Changed
- **Breaking:** Refactor `ScattermapChartDataOptions.geo` (beta) to use `StyledColumn`, instead `ScattermapColumn` (removed).
- **Breaking:** Refactor `ScattermapChartDataOptions.geo` (beta) to use `StyledColumn`, instead of `ScattermapColumn` (removed).
Prop `ScattermapColumn.level` has been replaced with `StyledColumn.geoLevel`
- Support HTML content in component `Table`
- Support theme settings for `IndicatorChart` in ticker mode
Expand Down
31 changes: 29 additions & 2 deletions docs-md/sdk/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,37 @@
# Changelog

## [1.20.0] - 2024-10-01

### Added
- Add `widgetModelTranslator` for translating between a widget model and related component props
- Add `dashboardModelTranslator` for translating between a dashboard model and related component props
- Add hook `useExecutePluginQuery` (alpha) for use in plugin components
- Implement custom context menu and sub-menu for dashboard cross-filtering and drilldown
- Add internal change detection props and hook to coordinate cross filtering and drilldown
- Support drilldown hierarchies (including predefined date hierarchies) for `ChartWidget`, `DrilldownWidget` for internal testing
- Add hook `useGetHierarchyModels` that retrieves existing hierarchy models from Fusion
- Add plugin `highcharts-rounded-corners` for Highcharts (internal charting library)


### Changed
- **Breaking:** Restructure `DashboardProps` for beta release: `widgets` to using `WidgetProps[]`, instead of `WidgetModel[]`, `layout` to `layoutOptions`, `widgetFilterOptions` to `widgetOptions`
- Deprecate `get*Props()` on `WidgetModel` – use utility functions of `widgetModelTranslator` instead
- Move components `DashboardById` and `Dashboard` to beta for React, Angular, and Vue
- Support dashboards of multiple data sources
- Handle Fusion date formats from locale
- Extend data point entries with `displayValue`
- Consolidate interface for custom chart plugins
- Improve fitlers: translation of `doesn't equal` filter, update of `CriteriaFilterTile`, formula in ranked filter
- Replace `fetch-intercept` with an isolated in-house implementation
- Extend CLI `get-data-model` to support perspectives
- Improve charts: "No Results" overlay added to all charts, data options validation for trend or forecast, polar chart stacking and value labels disabling
- Improve pivot tables: container size, additional visual tests

## [1.19.0] - 2024-09-17

### Added
- Support loading of fonts from Fusion
- Support dashboard rendering of text widgets and chart plugins
- Support dashboard rendering of text widgets and chart plugins for internal testing

### Changed
- Fix missing spaces in headings for `MemberFilterTile`, `Table`, and `PivotTable`
Expand Down Expand Up @@ -267,7 +294,7 @@ in hooks `useGetDashboardModel`, `useGetDashboardModels`, `useExecuteQueryByWidg
- Add component `PivotTable` (alpha) for React, Angular, and Vue

### Changed
- **Breaking:** Refactor `ScattermapChartDataOptions.geo` (beta) to use `StyledColumn`, instead `ScattermapColumn` (removed).
- **Breaking:** Refactor `ScattermapChartDataOptions.geo` (beta) to use `StyledColumn`, instead of `ScattermapColumn` (removed).
Prop `ScattermapColumn.level` has been replaced with `StyledColumn.geoLevel`
- Support HTML content in component `Table`
- Support theme settings for `IndicatorChart` in ticker mode
Expand Down
14 changes: 14 additions & 0 deletions docs-md/sdk/getting-started/authentication-security.md
Original file line number Diff line number Diff line change
Expand Up @@ -199,3 +199,17 @@ Set up CORS on your Sisense instance using one of the following:
- Save your settings changes after adding your domain.

:::

## Third-Party Cookies

Most modern browsers block third-party cookies. This affects cookie-based authentications such as SSO.

Therefore, the best practice is either to:

- Use the same domain for the different apps and put it behind a specific path. This prevents Sisense cookies from being third-party cookies. For example: `companyA.com/analytics`.
- Leverage the Web Access Tokens (WAT) feature for authentication. Note that WAT requires special licensing.
- Allow third-party cookies via your browser settings. See this [doc](https://docs.sisense.com/main/SisenseLinux/3rd-party-cookies.htm) for detailed instructions.

:::warning
The Cookies Having Independent Partitioned State ([CHIPS](https://developers.google.com/privacy-sandbox/cookies/chips)) solution is not compatible with Compose SDK.
:::
138 changes: 138 additions & 0 deletions docs-md/sdk/guides/chart-plugins.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
---
title: Chart Plugins
---

# Chart Plugins

> **Note**:
> This guide is for [<img src="../img/react-logo.png" height="18px" style="vertical-align: text-bottom; padding-bottom: 3px" /> React](./quickstart.md). Chart plugins are not currently supported in <img src="../img/angular-logo.png" height="18px" style="vertical-align: text-bottom; padding-bottom: 2px" /> Angular and <img src="../img/vue-logo.png" height="14px" /> Vue.
This guide explains how to define your own chart plugin component and register it in your application code, so that it will be automatically rendered (based on the corresponding widget type) when using the `DashboardById` component.

**Note:** It is assumed that the application is [already configured correctly](./quickstart.md) for use with Compose SDK.

## Sample dashboard

The `histogramwidget` plugin is included with Sisense Fusion, so we'll be using it as our example. We'll start by creating a dashboard in Fusion, containing a single `histogramwidget` widget with `Sample ECommerce` as its data source.

![Dashboard in Fusion](../img/plugins-guide/dashboard-in-fusion.png 'Dashboard in Fusion')

## Displaying the dashboard in your application

To display a dashboard using Compose SDK, we need the `oid` for the relevant dashboard. The simplest way to find this, is to copy the value from the end of the URL when viewing the dashboard in Fusion, e.g. `/app/main/dashboards/{dashboardOid}`.

The dashboard can be easily displayed using the `DashboardById` component, passing this value into the `dashboardOid` prop.

```ts
import { DashboardById } from '@sisense/sdk-ui';

function App() {
return (
<DashboardById dashboardOid={'66f23d1b202c89002abd64ac'} />;
);
}

export default App;
```

Since Compose SDK does not support the `histogramwidget` plugin out of the box (nor any other Fusion plugin widget) it is expected that Compose SDK will display an error in place of the histogram widget.

![Dashboard in Compose SDK (no registered plugin)](../img/plugins-guide/dashboard-in-csdk-unregistered.png 'Dashboard in Compose SDK (no registered plugin)')

In order to resolve this, we will explore how to define a plugin component and register it with Compose SDK, so that it knows what to do when it encounters a `histogramwidget`.

## Defining a plugin using Compose SDK

Before registering our plugin, we first need to define a custom plugin component that will:
1. Receive the props that Compose SDK will pass to our plugin when rendering the `DashboardById` component
2. Run a data query using those props
3. Render a visualization with the results

Purely for the **simplicity** of this guide, we have chosen to define a custom plugin component which renders a table of the query results. In reality, you would more likely define a React implementation of a histogram chart, or however else you wish to represent the presence of this plugin in a dashboard.

This guide also aims to demonstrate the flexibility of the `registerPlugin` interface - as long as you provide a functional component that matches the shape of [`PluginComponent`](../modules/sdk-ui/type-aliases/type-alias.PluginComponent.md), Compose SDK will render that component for the designated plugin.

A note on the `dataOptions` prop that is passed to our component: For those familiar with the Fusion plugin / add-on architecture, `dataOptions` is the Compose SDK equivalent of `panels` on the [WidgetMetadata](https://sisense.dev/guides/customJs/jsApiRef/widgetClass/widget-metadata.html) object.

Compose SDK translates all widget metadata and filters to Compose SDK data structures (e.g. values inside [`dataOptions`](../modules/sdk-ui/type-aliases/type-alias.ChartDataOptions.md) are of type [`StyledColumn`](../modules/sdk-ui/interfaces/interface.StyledColumn.md) and [`StyledMeasureColumn`](../modules/sdk-ui/interfaces/interface.StyledMeasureColumn.md), the same types you'd expect for [`dataOptions`](../modules/sdk-ui/type-aliases/type-alias.ChartDataOptions.md) into the [`Chart`](../modules/sdk-ui/charts/function.Chart.md) component).

In the custom plugin component, we can use the props directly with the `useExecutePluginQuery` hook which runs a data query and applies some formatting on the results (defined by the `StyledColumn` information in `dataOptions`).

```ts
import { DashboardById, PluginComponent, useExecutePluginQuery } from '@sisense/sdk-ui';

const ResultsTable: PluginComponent = (props) => {
const { data } = useExecutePluginQuery(props);

if (!data) {
return null;
}

return (
<table style={{ margin: '20px' }}>
<thead>
<tr>
{data.columns.map((column, columnIndex) => (
<th key={columnIndex}>{column.name}</th>
))}
</tr>
</thead>
<tbody>
{data.rows.map((row, rowIndex) => (
<tr key={rowIndex}>
{row.map((cell, cellIndex) => (
<td key={cellIndex}>{cell.text}</td>
))}
</tr>
))}
</tbody>
</table>
);
};

...
```

If you prefer to work with the raw data without any formatting applied, you can use `extractDimensionsAndMeasures` with `useExecuteQuery` instead.

```ts
import { useExecuteQuery, extractDimensionsAndMeasures } from '@sisense/sdk-ui';

const { dimensions, measures } = extractDimensionsAndMeasures(props.dataOptions);
const { data } = useExecuteQuery({
dimensions,
measures,
filters: props.filters,
});
```

## Registering the plugin with Compose SDK

To register the plugin, we need to call `registerPlugin`, which is returned from the `usePlugins` hook.

```ts
import { DashboardById, PluginComponent, useExecutePluginQuery, usePlugins } from '@sisense/sdk-ui';

...

function App() {
const { registerPlugin } = usePlugins();
registerPlugin('histogramwidget', ResultsTable);
return <DashboardById dashboardOid={'66f4d4dd384428002ae0a21d'} />;
};

...
```

If we refresh our application, instead of seeing the error in place of the widget as before, we should now see something like this:

![Dashboard in Compose SDK (registered plugin)](../img/plugins-guide/dashboard-in-csdk-registered.png 'Dashboard in Compose SDK (registered plugin)')

## Summary

Here's what we accomplished:
- Displayed an existing Fusion dashboard in our application by rendering a `DashboardById` component
- Created a React component that uses its props to execute a data query and display the results in a table
- Registered that table component to be shown in place of the `histogramwidget` when it is rendered inside of a `DashboardById` component

Obviously, we didn't end up with a new histogram component in React (yet), but hopefully the simplicity of this guide gives you the tools to you need to make that, or anything else, happen!
3 changes: 3 additions & 0 deletions docs-md/sdk/guides/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ indexTopics:
- title: Generative AI
description: Learn how to deliver conversational analytics using large language models (Beta)
link: ./ai-features
- title: Chart Plugins
description: Render a custom chart plugin with Compose SDK dashboards
link: ./chart-plugins
- title: Migration Guide
description: Migrate your project from 0.X.X to 1.0.0
link: ./migration-guide-1.0.0
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@ title: Chart Utilities

Utilities to be used with charts

- [ChartWidgetComponent](class.ChartWidgetComponent.md)
- [boxWhiskerProcessResult](function.boxWhiskerProcessResult.md)
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: DashboardComponent
---

# Class DashboardComponent <Badge type="fusionEmbed" text="Fusion Embed" /> <Badge type="alpha" text="Alpha" />
# Class DashboardComponent <Badge type="beta" text="Beta" />

An Angular component used for easily rendering a dashboard created in Sisense Fusion.

Expand All @@ -14,16 +14,17 @@ An Angular component used for easily rendering a dashboard created in Sisense Fu
<csdk-dashboard
*ngIf="dashboard"
[title]="dashboard!.title"
[layout]="dashboard!.layout"
[layoutOptions]="dashboard!.layoutOptions"
[widgets]="dashboard!.widgets"
[filters]="dashboard!.filters"
[defaultDataSource]="dashboard!.dataSource"
[widgetFilterOptions]="dashboard!.widgetFilterOptions"
[widgetsOptions]="dashboard!.widgetsOptions"
/>
```

```ts
import { Component } from '@angular/core';
import { type DashboardModel, DashboardService } from '@sisense/sdk-ui-angular';
import { type DashboardProps, DashboardService } from '@sisense/sdk-ui-angular';

@Component({
selector: 'app-dashboard',
Expand All @@ -32,12 +33,13 @@ import { type DashboardModel, DashboardService } from '@sisense/sdk-ui-angular';
})
export class DashboardComponent {

dashboard: DashboardModel | null = null;
dashboard: DashboardProps | null = null;

constructor(private dashboardService: DashboardService) {}

async ngOnInit(): Promise<void> {
this.dashboard = await this.dashboardService.getDashboardModel('60f3e3e3e4b0e3e3e4b0e3e3', { includeWidgets: true, includeFilters: true });
const dashboardModel = await this.dashboardService.getDashboardModel('60f3e3e3e4b0e3e3e4b0e3e3', { includeWidgets: true, includeFilters: true });
this.dashboardProps = dashboardModelTranslator.toDashboardProps(dashboardModel);
}
```
Expand Down Expand Up @@ -96,46 +98,46 @@ The default data source to use for the dashboard
#### filters
> **filters**: [`Filter`](../../sdk-data/interfaces/interface.Filter.md)[]
> **filters**: `undefined` \| [`Filter`](../../sdk-data/interfaces/interface.Filter.md)[]
The dashboard filters to be applied to each of the widgets based on the widget filter options
***
#### layout
#### layoutOptions
> **layout**: [`Layout`](../interfaces/interface.Layout.md)
> **layoutOptions**: `undefined` \| [`DashboardLayoutOptions`](../interfaces/interface.DashboardLayoutOptions.md)
The layout of the dashboard
Dashboard layout options
***
#### styleOptions
> **styleOptions**: [`DashboardStyleOptions`](../../sdk-ui/type-aliases/type-alias.DashboardStyleOptions.md)
> **styleOptions**: `undefined` \| [`DashboardStyleOptions`](../../sdk-ui/type-aliases/type-alias.DashboardStyleOptions.md)
The style options for the dashboard
***
#### title
> **title**: `string`
> **title**: `undefined` \| `string`
The title of the dashboard
***
#### widgetFilterOptions
#### widgets
> **widgetFilterOptions**: `undefined` \| [`WidgetFilterOptions`](../type-aliases/type-alias.WidgetFilterOptions.md)
> **widgets**: [`WidgetProps`](../type-aliases/type-alias.WidgetProps.md)[]
The filter options for each of the widgets
The widgets to render in the dashboard
***
#### widgets
#### widgetsOptions
> **widgets**: [`WidgetModel`](class.WidgetModel.md)[]
> **widgetsOptions**: `undefined` \| [`WidgetsOptions`](../type-aliases/type-alias.WidgetsOptions.md)
The widgets to render in the dashboard
The options for each of the widgets
10 changes: 10 additions & 0 deletions docs-md/sdk/modules/sdk-ui-angular/dashboarding/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
title: Dashboarding
---

# Dashboarding

Angular modules, services, and components for composing dashboards

- [ChartWidgetComponent](class.ChartWidgetComponent.md)
- [DashboardComponent](class.DashboardComponent.md) <Badge type="beta" text="Beta" />
Loading

0 comments on commit 1a9f78d

Please sign in to comment.