@cumul.io/vue-cumulio-dashboard

中文文档
3.0.2发布于 2024/01/23TypeScriptES Module零依赖近 30 天下载 2069

Vue.js Cumul.io 车板

此软件包已被标记为弃用

Deprecated in favor of @luzmo/vue-embed

中文使用文档
文档目录14 节
  1. 目录
  2. 安装指令
  3. 使用量
  4. 第3组
  5. 备选案文2
  6. 活动
  7. 公共方法
  8. 实例
  9. 更改日志
  10. 移徙
  11. 从2.X.X- > 3.X.X版本迁移
  12. 从1.X.X - > 2.X.X版本迁移
  13. 从"0.X.X- > 1.X.X.X
  14. 快速链接

折旧

这个套件已经贬值,有利于 @luzmo/vue-embed (英语)

Vue.js Cumul.io 车板

这是 Vue.js 嵌入库 卡穆尔.io vue 2或Vue 3应用程序中的仪表板.

目录

  1. 安装指令
  2. 使用量
  3. 活动
  4. 公共方法
  5. 实例
  6. 更改日志
  7. 移徙
  8. 快速链接

安装指令

npm i @cumul.io/vue-cumulio-dashboard

使用量

第3组

import { createApp } from 'vue';
import App from './App.vue';
import VueCumulioDashboard from '@cumul.io/vue-cumulio-dashboard';

const app = createApp(App);
// Defines the component at app level
app.use(VueCumulioDashboard);
app.mount('#app');

备选案文2

import Vue from 'vue';
import App from './App.vue';
import VueCumulioDashboard from '@cumul.io/vue-cumulio-dashboard/vue2';

Vue.use(VueCumulioDashboard);

new Vue({
  render: (h) => h(App),
}).$mount('#app');

在您的 HTML 模板中.

<cumulio-dashboard
  ref="dashboardInstance"
  :dashboardId="dashboardId"
  :language="'en'">
</cumulio-dashboard>

OR

<!-- Embed a Item by passing the item id as well -->
<cumulio-dashboard
  ref="dashboardInstance"
  :dashboardId="dashboardId"
  :itemId="itemId"
  :language="'en'">
</cumulio-dashboard>

可用的道具
在可用的道具列表下可以添加到您的 Cumulio-dashboard

财产类型说明
dashboardId字符串您想要嵌入的 Cumul.io 仪表板的标识
dashboardSlug字符串您想要嵌入的 Cumul.io 仪表板的弹片( 如果提供仪表板Id, 将使用)
itemId字符串您想要嵌入的 Cumul.io 项的 ID
itemDimensions{宽:数/弦;高:数/弦;}只有在提供了项目ID时才适用项目的宽度和高度.
authKey字符串通过 Cumul.io API 生成的授权密钥
authToken字符串通过 Cumul.io API 生成的授权令牌
language字符串仪表板语言: 如"en"(默认:"auto")
screenMode字符串您的仪表板的屏幕模式 : “ 移动 ” 、 “ 平板 ” 、 “ 桌面 ” 、 “ 大屏幕 ” 、 “ 固定 ” 或 “ 自动 ” (默认 : “ 自动 ” )
switchScreenModeOnResize布尔真:嵌入式仪表板可以在改变容器大小时切换屏幕Modes,假:Dashboard会保留同一种屏幕Mode(默认:真实)
loaderBackground字符串加载器元素的背景颜色( 默认 : '# f9f9f9' )
loaderFontColor字符串装入器文字的字体颜色( 默认 : '# 5a5a5a5a' )
loaderSpinnerColor字符串装入器的自旋颜色( 默认 : “ rgba( 255, 165, 0, 0. 7) ”)
loaderSpinnerBackground字符串旋转器的背景颜色( 默认 : “ rgba( 169, 169, 169, 0. 14) ”)
appServer字符串Cumul.io 连接的租借(默认:"https://app.cumul.io/" 美国设置的应用程序Server 到"https://app.us.cumul.io/")
timezoneId字符串你想在仪表板上使用的时区 这个时区 id 需要是一个有效的 id , 可以在 IANA 时区数据库例如:欧洲/布鲁塞尔或美洲/纽约.
apiHost字符串要连接的 API 服务器 (default: 'https://api. cumul.io/' for USs set apiHost to 'https://api.us.cumul.io/')
editMode字符串指定嵌入式仪表板是否可编辑。 接受值:"视图","编辑Limited","编辑Full". 不希望嵌入式仪表板可编辑时使用"视图". (过失:"观"
mainColor字符串对嵌入式仪表板编辑器白标签中使用的主色调可选更改. 如果不提供,则使用组织上所设置的白色标签颜色的主要颜色。 应当指定为 rgb 值的字符串(即 “ rgb( 50, 50, 50) ”) .
accentColor字符串嵌入式仪表板编辑器的白标签中使用的口音颜色的可选覆盖. 如果不提供,则使用组织上所设置的白标签颜色的口音颜色。 应当指定为 rgb 值的字符串(即 “ rgb( 50, 50, 50) ”) .



活动

名称说明事件参数
@ 已更改 过滤器过滤器被更改时退出ChangedFiltersEvent
@ 习惯事件解除自定义事件时退出CustomEvent
@ 导出导出完成或失败时发出ExportedEvent
@ items 渲染当所有物品都提供时, 才被放出ItemsRenderedEvent
@ 载入装入仪表板时放出LoadEvent

公共方法

构成部分

...

export default {
  name: 'Example',

  methods: {
    // To refresh data from item / dashboard
    refreshData(itemId){
      this.$refs.dashboardInstance.refreshData(itemId);
    },

    // Get data from a item
    async getData(){
      const result = await this.$refs.dashboardInstance.getData('6759f444-32b8-42d8-8786-eb88fc2a194');
      console.log(result)
    },

  }

  ...

}
getDashboards(): Promise<any[]>
// Returns an instantly resolved promise with an array of all the visible dashboards on a page with their information.

getFilters(): Promise<FilterGroup[]>
// Returns an instantly resolved promise with an array of all visible dashboards with their active filters.

getData(itemId: string ): Promise<ItemData[]>
// Returns a promise with the data of a item.

setAuthorization(key: string, token: string): Promise<void>
// Changes the authorization of all or one dashboard. Returns an empty promise.

refreshData(id?: string): Promise<void>
// Refreshes the data of a specific item when the id of that item is supplied. Without a itemId this refreshes the data in all items. Returns an empty promise.

reloadDashboard(): Promise<void>
// Reload the dashboard. (useful when the authorization is changed, and dashboard needs to be reloaded without reloading the iFrame). Returns an empty promise.

exportDashboard(type?: string): Promise<ExportDashboard>
// Exports the current dashboard as either pdf or png. a container class needs to be passed as an argument and an optional type parameter. Returns a promise with information on the export.

getAccessibleDashboards(): Promise<AccessibleDashboard[]>
// Get accessible dashboards in a integration, provide either dashboardId, dashboardSlug, container if a dashboard is already loaded.
// Or provide authKey, apiHost and authToken

setEditMode(editMode: string): Promise<void>
// Sets the editMode of the current dashboard. Accepted parameters: view , editLimited , editFull .

实例

带有灰色加载器背景的仪表板

<cumulio-dashboard
  ref="dashboardInstance"
  :dashboardId="dashboardId"
  :loaderBackground="'rgb(238,243,246)'">
</cumulio-dashboard>

带有紫色加载器自旋器颜色的仪表板,屏幕 Mode 移动和开关ScreenModeOnResize 虚假,这样仪表板将保持移动模式

<cumulio-dashboard
  ref="dashboardInstance"
  :dashboardId="dashboardId"
  :loaderSpinnerColor="'purple'"
  :screenMode="'mobile'"
  @load="logEvent"
  :switchScreenModeOnResize="false">
</cumulio-dashboard>

更改日志

移徙

从2.X.X- > 3.X.X版本迁移

  • 过滤器显示为 FilterGroup 数组代替一个 Filter 阵列. FilterGroup 是一个包含过滤器列表和(或)描述其关系的条件的对象. FilterGroup 也可以有儿童组支持复杂的过滤逻辑
// FilterGroup 
{
  id: string;
  condition: 'and' | 'or';
  filters: Filter[]; 
  subGroups: FilterGroup[];
  origin: string;
  datasetId?: string; // dataset id in case of dahsboard level filters
  itemId?: string; // chart id in case of chart level filters
}

// Filter
{
  expression: string;
  parameters: [];
  properties: {
    id: string;
    origin: string;
    type: string;
    itemId: string;
    ignore?: string[];
  }
}
  • getFilters() 方法响应和 changedFilters 事件数据现在包含过滤器,作为 FilterGroup 对象代替 Filter 对象
getFilters(): Promise<FilterGroup[]>
// changedFilters event data
{
  changed: FilterGroup[]; // changed filters
  filters: FilterGroup[]; // all filters
  // ... other event properties
}

从1.X.X - > 2.X.X版本迁移

路边 vue-cumulio-dashboard 为 vue2 导入已更改。 您现在可以通过以下方式导入 .

import VueCumulioDashboard from '@cumul.io/vue-cumulio-dashboard/vue2';

Vue3的进口保持不变.

import VueCumulioDashboard from '@cumul.io/vue-cumulio-dashboard';

从"0.X.X- > 1.X.X.X

  • 所有服务方法,例如 CumulioService.getFilters, (中文(简体) ), CumulioService.getData .现在应调用组件实例(可用 $refs) (中文(简体) ).
  • chartId 现在叫做 itemId, (中文(简体) ), charts-rendered 现在叫做 items-rendered
  • 所有事件现在都属于格式 { data: { ...eventData } }, (中文(简体) ), eventData 属于格式
{
  dashboardId?: string;
  dashboardSlug?: string;
  itemId?: string;
  language: string;
  name: string;
  screenMode: string;
  type: string;
  dimensions?: object; // populated depending on the event
  changed?: [];  // populated depending on the event
  filters?: [];  // populated depending on the event
  item?: string;    // populated depending on the event
  origin?: string;  // populated depending on the event
  object?: string;  // populated depending on the event
  data?: object;       // populated depending on the event
}
  • getFilters 现在返回一系列过滤器. [...objectOfFilters], (中文(简体) ), objectOfFilters 属于格式
[{
  expression: string;
  parameters: [];
  properties: {
    id: string;
    ignore?: string[];
    origin: string;
    type: string;
    viz: string;
  }
}]

为了更多 迁移请点击此处。 。 。 .

卡穆尔.io | Vue2 代码框示例 | Vue3 代码框示例 | 更改日志 | 移徙

版本与发布记录

@cumul.io/vue-cumulio-dashboard 共发布 50 个版本,首次发布于 2021/04/22;过去 12 个月发布了 0 个版本。

版本发布日期距今
3.0.2latest2024/01/232 年前
3.0.12023/06/163 年前
3.0.02023/03/223 年前
2.1.02023/02/133 年前
2.0.172023/01/273 年前
2.0.162023/01/203 年前

关于 @cumul.io/vue-cumulio-dashboard 的常见问题

@cumul.io/vue-cumulio-dashboard 是什么?

Vue.js Cumul.io 车板注意:该包已被作者标记为弃用——Deprecated in favor of @luzmo/vue-embed

如何安装 @cumul.io/vue-cumulio-dashboard?

在项目目录运行 npm install @cumul.io/vue-cumulio-dashboard,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:vue(^2.0.0 || >=3.0.0)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@cumul.io/vue-cumulio-dashboard 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@cumul.io/vue-cumulio-dashboard 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@cumul.io/vue-cumulio-dashboard 可以商用吗?

@cumul.io/vue-cumulio-dashboard 使用 未声明 许可。package.json 没有声明许可证。没有许可证的代码默认保留全部权利,商用前请联系作者或查看仓库中的 LICENSE 文件。以上为概括,不构成法律意见,请以许可原文为准。

@cumul.io/vue-cumulio-dashboard 的下载量有多少?

根据 npm 官方下载统计,@cumul.io/vue-cumulio-dashboard 在 2026/10/11 – 2026/11/09 这 30 天内被下载 2,069 次,日均约 69 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@cumul.io/vue-cumulio-dashboard 还在维护吗?

最新版本 3.0.2 发布于 2024/01/23(2 年前);至今共发布 50 个版本,其中过去 12 个月发布了 0 个;首次发布于 2021/04/22。作者已将其标记为弃用,新项目建议寻找替代方案。