diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index f651cad..7082019 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -1,62 +1,49 @@ -# For most projects, this workflow file will not need changing; you simply need -# to commit it to your repository. -# -# You may wish to alter this file to override the set of languages analyzed, -# or to provide custom queries or build logic. name: "CodeQL" on: push: - branches: [main] + branches: [main, dev, certification] pull_request: - # The branches below must be a subset of the branches above - branches: [main] + branches: [main, dev, certification] schedule: - - cron: '0 6 * * 4' + - cron: '0 0 * * 3' jobs: analyze: name: Analyze runs-on: ubuntu-latest + timeout-minutes: 60 + permissions: + actions: read + contents: read + security-events: write strategy: fail-fast: false matrix: - # Override automatic language detection by changing the below list - # Supported options are ['csharp', 'cpp', 'go', 'java', 'javascript', 'python'] - language: ['javascript'] - # Learn more... - # https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#overriding-automatic-language-detection - + language: ['typescript'] + steps: - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v4 + with: + fetch-depth: 2 + + - name: Use Node.js 18 + uses: actions/setup-node@v2 + with: + node-version: 18.x + + - name: Install Dependencies + run: npm ci - # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL - uses: github/codeql-action/init@v1 + uses: github/codeql-action/init@v3 with: languages: ${{ matrix.language }} - # If you wish to specify custom queries, you can do so here or in a config file. - # By default, queries listed here will override any specified in a config file. - # Prefix the list here with "+" to use these queries and those in the config file. - # queries: ./path/to/local/query, your-org/your-repo/queries@main - # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). - # If this step fails, then you should remove it and run the build manually (see below) - name: Autobuild - uses: github/codeql-action/autobuild@v1 - - # ℹī¸ Command-line programs to run using the OS shell. - # 📚 https://git.io/JvXDl - - # ✏ī¸ If the Autobuild fails above, remove it and uncomment the following three lines - # and modify them (or add more) to build your code if your project - # uses a compiled language - - #- run: | - # make bootstrap - # make release + uses: github/codeql-action/autobuild@v3 - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v1 + uses: github/codeql-action/analyze@v3 diff --git a/CHANGELOG.md b/CHANGELOG.md index 971e234..1666ccf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +## 3.4.3.0 +* Fix weight with zero values + ## 3.4.2.0 * Fix context menu for links and nodes diff --git a/package-lock.json b/package-lock.json index 9289920..45720d2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "powerbi-visuals-sankey", - "version": "3.4.2.0", + "version": "3.4.3.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "powerbi-visuals-sankey", - "version": "3.4.2.0", + "version": "3.4.3.0", "license": "MIT", "dependencies": { "d3-array": "^3.2.4", diff --git a/package.json b/package.json index 8d245f7..dfe405c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "powerbi-visuals-sankey", - "version": "3.4.2.0", + "version": "3.4.3.0", "description": "Sankey is a type of flow diagram in which the width of the series is in proportion to the quantity of the flow. Use it to find major contributions to an overall flow.", "repository": { "type": "git", diff --git a/pbiviz.json b/pbiviz.json index ce37769..8dd4835 100644 --- a/pbiviz.json +++ b/pbiviz.json @@ -1,10 +1,10 @@ { "visual": { "name": "SankeyDiagram", - "displayName": "Sankey 3.4.2.0", + "displayName": "Sankey 3.4.3.0", "guid": "sankey02300D1BE6F5427989F3DE31CCA9E0F32020", "visualClassName": "SankeyDiagram", - "version": "3.4.2.0", + "version": "3.4.3.0", "description": "Sankey is a type of flow diagram in which the width of the series is in proportion to the quantity of the flow. Use it to find major contributions to an overall flow.", "supportUrl": "https://community.powerbi.com", "gitHubUrl": "https://github.com/Microsoft/powerbi-visuals-sankey" diff --git a/src/sankeyDiagram.ts b/src/sankeyDiagram.ts index 875143e..5a3afeb 100644 --- a/src/sankeyDiagram.ts +++ b/src/sankeyDiagram.ts @@ -43,6 +43,7 @@ type UpdateSelection = d3Selection; // powerbi import DataView = powerbi.DataView; import IViewport = powerbi.IViewport; +import PrimitiveValue = powerbi.PrimitiveValue; import DataViewObjects = powerbi.DataViewObjects; import VisualObjectInstance = powerbi.VisualObjectInstance; import DataViewObjectPropertyIdentifier = powerbi.DataViewObjectPropertyIdentifier; @@ -156,7 +157,7 @@ export class SankeyDiagram implements IVisual { private static DefaultFormatOfWeight: string = "g"; private static DefaultWeightValue: number = 0; - private static MinWeightValue: number = 1; + private static MinWeightValue: number = 0; private static TooltipDisplayName: string = "Name"; @@ -461,7 +462,7 @@ export class SankeyDiagram implements IVisual { dataView.matrix.rows.root.children.forEach(parent => { const foundSource: SankeyDiagramNode = nodes.find(found => found.label.name === parent.value) parent.children.forEach(child => { - let linkLabel = undefined; + let linkLabel: PrimitiveValue = undefined; let weight: number = SankeyDiagram.DefaultWeightValue; let foundDestination: SankeyDiagramNode = nodes.find(found => found.label.name === child.value) @@ -509,7 +510,7 @@ export class SankeyDiagram implements IVisual { ); const link: SankeyDiagramLink = { - label: linkLabel && linkLabel.toString(), + label: linkLabel?.toString(), source: foundSource, destination: foundDestination, weight: weight,