From 220ec2b5566289802e11b8dae299bfeaef51143a Mon Sep 17 00:00:00 2001 From: Mathieu Bruyen Date: Wed, 29 Jun 2022 16:02:57 +0200 Subject: [PATCH 1/4] feature: allow selecting round or square line cap on line charts --- src/core-enums.ts | 2 +- src/core-interfaces.ts | 11 +++++++++++ src/gen-charts.ts | 23 ++++++++++++++++++----- src/gen-objects.ts | 4 ++++ types/index.d.ts | 11 +++++++++++ 5 files changed, 45 insertions(+), 6 deletions(-) diff --git a/src/core-enums.ts b/src/core-enums.ts index c60c6afee..f2b34acd6 100644 --- a/src/core-enums.ts +++ b/src/core-enums.ts @@ -18,7 +18,7 @@ export const DEF_CELL_BORDER: BorderProps = { type: 'solid', color: '666666', pt export const DEF_CELL_MARGIN_PT: [number, number, number, number] = [3, 3, 3, 3] // TRBL-style // DEPRECATED 3.8.0 export const DEF_CELL_MARGIN_IN: [number, number, number, number] = [0.05, 0.1, 0.05, 0.1] // "Normal" margins in PPT-2021 ("Narrow" is `0.05` for all 4) export const DEF_CHART_BORDER: BorderProps = { type: 'solid', color: '363636', pt: 1 } -export const DEF_CHART_GRIDLINE: OptsChartGridLine = { color: '888888', style: 'solid', size: 1 } +export const DEF_CHART_GRIDLINE: OptsChartGridLine = { color: '888888', style: 'solid', size: 1, cap: 'flat' } export const DEF_FONT_COLOR: string = '000000' export const DEF_FONT_SIZE: number = 12 export const DEF_FONT_TITLE_SIZE: number = 18 diff --git a/src/core-interfaces.ts b/src/core-interfaces.ts index 2febb219e..cfe3bc618 100644 --- a/src/core-interfaces.ts +++ b/src/core-interfaces.ts @@ -1153,6 +1153,10 @@ export interface OptsChartGridLine { * Gridline style */ style?: 'solid' | 'dash' | 'dot' | 'none' + /** + * Line cap + */ + cap?: ChartLineCap } // TODO: 202008: chart types remain with predicated with "I" in v3.3.0 (ran out of time!) export interface IChartMulti { @@ -1388,6 +1392,7 @@ export interface IChartPropsChartDoughnut { dataNoEffects?: boolean holeSize?: number } +export type ChartLineCap = 'flat' | 'square' | 'round' export interface IChartPropsChartLine { lineDash?: 'dash' | 'dashDot' | 'lgDash' | 'lgDashDot' | 'lgDashDotDot' | 'solid' | 'sysDash' | 'sysDot' /** @@ -1422,6 +1427,12 @@ export interface IChartPropsChartLine { * @default 2 */ lineSize?: number + /** + * MS-PPT > Chart format > Format Data Series > Line > Cap type + * - line cap type + * @default flat + */ + lineCap?: ChartLineCap /** * MS-PPT > Chart format > Format Data Series > Line > Smoothed line * - "Smoothed line" diff --git a/src/gen-charts.ts b/src/gen-charts.ts index 8f7b743b5..1244dbfdc 100644 --- a/src/gen-charts.ts +++ b/src/gen-charts.ts @@ -19,7 +19,7 @@ import { LETTERS, ONEPT, } from './core-enums' -import { IChartOptsLib, ISlideRelChart, ShadowProps, IChartPropsTitle, OptsChartGridLine, IOptsChartData } from './core-interfaces' +import { IChartOptsLib, ISlideRelChart, ShadowProps, IChartPropsTitle, OptsChartGridLine, IOptsChartData, ChartLineCap } from './core-interfaces' import { createColorElement, genXmlColorSelection, convertRotationDegrees, encodeXmlEntities, getMix, getUuid, valToPts } from './gen-utils' import JSZip from 'jszip' @@ -878,14 +878,14 @@ function makeChartType(chartType: CHART_NAME, data: IOptsChartData[], opts: ICha if (opts.lineSize === 0) { strXml += '' } else { - strXml += '' + createColorElement(seriesColor) + '' + strXml += '' + createColorElement(seriesColor) + '' strXml += '' } } else if (opts.dataBorder) { strXml += '' + + '" cap="' + createLineCap(opts.lineCap) + '">' + createColorElement(opts.dataBorder.color) + '' } @@ -1132,7 +1132,7 @@ function makeChartType(chartType: CHART_NAME, data: IOptsChartData[], opts: ICha if (opts.lineSize === 0) { strXml += '' } else { - strXml += '' + createColorElement(tmpSerColor) + '' + strXml += '' + createColorElement(tmpSerColor) + '' strXml += '' } @@ -2107,7 +2107,7 @@ function createShadowElement(options: ShadowProps, defaults: object): string { function createGridLineElement(glOpts: OptsChartGridLine): string { let strXml: string = '' strXml += ' ' - strXml += ' ' + strXml += ' ' strXml += ' ' // should accept scheme colors as implemented in [Pull #135] strXml += ' ' strXml += ' ' @@ -2116,3 +2116,16 @@ function createGridLineElement(glOpts: OptsChartGridLine): string { return strXml } + +function createLineCap(lineCap: ChartLineCap): string { + if (!lineCap || lineCap === 'flat') { + return 'flat'; + } else if (lineCap === 'square') { + return 'sq'; + } else if (lineCap === 'round') { + return 'rnd'; + } else { + const neverLineCap: never = lineCap; + throw new Error(`Invalid chart line cap: ${neverLineCap}`); + } +} diff --git a/src/gen-objects.ts b/src/gen-objects.ts index 96499c2a8..0f7f71a4d 100644 --- a/src/gen-objects.ts +++ b/src/gen-objects.ts @@ -137,6 +137,10 @@ export function addChartDefinition(target: PresSlide, type: CHART_NAME | IChartM console.warn('Warning: chart.gridLine.style options: `solid`, `dash`, `dot`.') delete glOpts.style } + if (glOpts.cap && ['flat', 'square', 'round'].indexOf(glOpts.cap) < 0) { + console.warn('Warning: chart.gridLine.cap options: `flat`, `square`, `round`.') + delete glOpts.cap + } } let chartId = ++_chartCounter diff --git a/types/index.d.ts b/types/index.d.ts index 3ac0b6546..e4e882e26 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -1943,6 +1943,10 @@ declare namespace PptxGenJS { * Gridline style */ style?: 'solid' | 'dash' | 'dot' | 'none' + /** + * Line cap + */ + cap?: ChartLineCap } // TODO: 202008: chart types remain with predicated with "I" in v3.3.0 (ran out of time!) export interface IChartMulti { @@ -2178,6 +2182,7 @@ declare namespace PptxGenJS { dataNoEffects?: boolean holeSize?: number } + export type ChartLineCap = 'flat' | 'square' | 'round' export interface IChartPropsChartLine { lineDash?: 'dash' | 'dashDot' | 'lgDash' | 'lgDashDot' | 'lgDashDotDot' | 'solid' | 'sysDash' | 'sysDot' /** @@ -2212,6 +2217,12 @@ declare namespace PptxGenJS { * @default 2 */ lineSize?: number + /** + * MS-PPT > Chart format > Format Data Series > Line > Cap type + * - line cap type + * @default flat + */ + lineCap?: ChartLineCap /** * MS-PPT > Chart format > Format Data Series > Line > Smoothed line * - "Smoothed line" From 3d473288e27d0e63831b7f20b81ea1506df4a179 Mon Sep 17 00:00:00 2001 From: Brent Ely Date: Sun, 22 Jan 2023 18:30:57 -0600 Subject: [PATCH 2/4] updated version --- src/pptxgen.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pptxgen.ts b/src/pptxgen.ts index 905111cc1..953c7c469 100644 --- a/src/pptxgen.ts +++ b/src/pptxgen.ts @@ -97,7 +97,7 @@ import * as genMedia from './gen-media' import * as genTable from './gen-tables' import * as genXml from './gen-xml' -const VERSION = '3.11.0' +const VERSION = '3.12.0-beta-20230122-1830' export default class PptxGenJS implements IPresentationProps { // Property getters/setters From 4e9b72c4875e6f69d6904a3aaee6ef42e5e2349a Mon Sep 17 00:00:00 2001 From: Brent Ely Date: Sun, 22 Jan 2023 19:23:09 -0600 Subject: [PATCH 3/4] updated new defs; formatted --- src/core-interfaces.ts | 256 ++++++++++++++++++++-------------------- types/index.d.ts | 257 +++++++++++++++++++++-------------------- 2 files changed, 264 insertions(+), 249 deletions(-) diff --git a/src/core-interfaces.ts b/src/core-interfaces.ts index cfe3bc618..8426dfdf1 100644 --- a/src/core-interfaces.ts +++ b/src/core-interfaces.ts @@ -259,80 +259,80 @@ export interface TextBaseProps { * @default false */ bullet?: - | boolean - | { - /** - * Bullet type - * @default bullet - */ - type?: 'bullet' | 'number' - /** - * Bullet character code (unicode) - * @since v3.3.0 - * @example '25BA' // 'BLACK RIGHT-POINTING POINTER' (U+25BA) - */ - characterCode?: string - /** - * Indentation (space between bullet and text) (points) - * @since v3.3.0 - * @default 27 // DEF_BULLET_MARGIN - * @example 10 // Indents text 10 points from bullet - */ - indent?: number - /** - * Number type - * @since v3.3.0 - * @example 'romanLcParenR' // roman numerals lower-case with paranthesis right - */ - numberType?: - | 'alphaLcParenBoth' - | 'alphaLcParenR' - | 'alphaLcPeriod' - | 'alphaUcParenBoth' - | 'alphaUcParenR' - | 'alphaUcPeriod' - | 'arabicParenBoth' - | 'arabicParenR' - | 'arabicPeriod' - | 'arabicPlain' - | 'romanLcParenBoth' - | 'romanLcParenR' - | 'romanLcPeriod' - | 'romanUcParenBoth' - | 'romanUcParenR' - | 'romanUcPeriod' - /** - * Number bullets start at - * @since v3.3.0 - * @default 1 - * @example 10 // numbered bullets start with 10 - */ - numberStartAt?: number + | boolean + | { + /** + * Bullet type + * @default bullet + */ + type?: 'bullet' | 'number' + /** + * Bullet character code (unicode) + * @since v3.3.0 + * @example '25BA' // 'BLACK RIGHT-POINTING POINTER' (U+25BA) + */ + characterCode?: string + /** + * Indentation (space between bullet and text) (points) + * @since v3.3.0 + * @default 27 // DEF_BULLET_MARGIN + * @example 10 // Indents text 10 points from bullet + */ + indent?: number + /** + * Number type + * @since v3.3.0 + * @example 'romanLcParenR' // roman numerals lower-case with paranthesis right + */ + numberType?: + | 'alphaLcParenBoth' + | 'alphaLcParenR' + | 'alphaLcPeriod' + | 'alphaUcParenBoth' + | 'alphaUcParenR' + | 'alphaUcPeriod' + | 'arabicParenBoth' + | 'arabicParenR' + | 'arabicPeriod' + | 'arabicPlain' + | 'romanLcParenBoth' + | 'romanLcParenR' + | 'romanLcPeriod' + | 'romanUcParenBoth' + | 'romanUcParenR' + | 'romanUcPeriod' + /** + * Number bullets start at + * @since v3.3.0 + * @default 1 + * @example 10 // numbered bullets start with 10 + */ + numberStartAt?: number - // DEPRECATED + // DEPRECATED - /** - * Bullet code (unicode) - * @deprecated v3.3.0 - use `characterCode` - */ - code?: string - /** - * Margin between bullet and text - * @since v3.2.1 - * @deplrecated v3.3.0 - use `indent` - */ - marginPt?: number - /** - * Number to start with (only applies to type:number) - * @deprecated v3.3.0 - use `numberStartAt` - */ - startAt?: number - /** - * Number type - * @deprecated v3.3.0 - use `numberType` - */ - style?: string - } + /** + * Bullet code (unicode) + * @deprecated v3.3.0 - use `characterCode` + */ + code?: string + /** + * Margin between bullet and text + * @since v3.2.1 + * @deplrecated v3.3.0 - use `indent` + */ + marginPt?: number + /** + * Number to start with (only applies to type:number) + * @deprecated v3.3.0 - use `numberStartAt` + */ + startAt?: number + /** + * Number type + * @deprecated v3.3.0 - use `numberType` + */ + style?: string + } /** * Text color * - `HexColor` or `ThemeColor` @@ -394,23 +394,23 @@ export interface TextBaseProps { */ underline?: { style?: - | 'dash' - | 'dashHeavy' - | 'dashLong' - | 'dashLongHeavy' - | 'dbl' - | 'dotDash' - | 'dotDashHeave' - | 'dotDotDash' - | 'dotDotDashHeavy' - | 'dotted' - | 'dottedHeavy' - | 'heavy' - | 'none' - | 'sng' - | 'wavy' - | 'wavyDbl' - | 'wavyHeavy' + | 'dash' + | 'dashHeavy' + | 'dashLong' + | 'dashLongHeavy' + | 'dbl' + | 'dotDash' + | 'dotDashHeave' + | 'dotDotDash' + | 'dotDotDashHeavy' + | 'dotted' + | 'dottedHeavy' + | 'heavy' + | 'none' + | 'sng' + | 'wavy' + | 'wavyDbl' + | 'wavyHeavy' color?: Color } /** @@ -1105,6 +1105,8 @@ export interface OptsDataLabelPosition { */ export type ChartAxisTickMark = 'none' | 'inside' | 'outside' | 'cross' +export type ChartLineCap = 'flat' | 'round' | 'square' + export interface OptsChartData { _dataIndex?: number @@ -1140,6 +1142,12 @@ export interface IOptsChartData extends OptsChartData { labels?: string[][] } export interface OptsChartGridLine { + /** + * MS-PPT > Chart format > Format Major Gridlines > Line > Cap type + * - line cap type + * @default flat + */ + cap?: ChartLineCap /** * Gridline color (hex) * @example 'FF3399' @@ -1153,10 +1161,6 @@ export interface OptsChartGridLine { * Gridline style */ style?: 'solid' | 'dash' | 'dot' | 'none' - /** - * Line cap - */ - cap?: ChartLineCap } // TODO: 202008: chart types remain with predicated with "I" in v3.3.0 (ran out of time!) export interface IChartMulti { @@ -1392,8 +1396,18 @@ export interface IChartPropsChartDoughnut { dataNoEffects?: boolean holeSize?: number } -export type ChartLineCap = 'flat' | 'square' | 'round' export interface IChartPropsChartLine { + /** + * MS-PPT > Chart format > Format Data Series > Line > Cap type + * - line cap type + * @default flat + */ + lineCap?: ChartLineCap + /** + * MS-PPT > Chart format > Format Data Series > Marker Options > Built-in > Type + * - line dash type + * @default solid + */ lineDash?: 'dash' | 'dashDot' | 'lgDash' | 'lgDashDot' | 'lgDashDotDot' | 'solid' | 'sysDash' | 'sysDot' /** * MS-PPT > Chart format > Format Data Series > Marker Options > Built-in > Type @@ -1427,12 +1441,6 @@ export interface IChartPropsChartLine { * @default 2 */ lineSize?: number - /** - * MS-PPT > Chart format > Format Data Series > Line > Cap type - * - line cap type - * @default flat - */ - lineCap?: ChartLineCap /** * MS-PPT > Chart format > Format Data Series > Line > Smoothed line * - "Smoothed line" @@ -1510,21 +1518,21 @@ export interface IChartPropsTitle extends TextBaseProps { } export interface IChartOpts extends IChartPropsAxisCat, - IChartPropsAxisSer, - IChartPropsAxisVal, - IChartPropsBase, - IChartPropsChartBar, - IChartPropsChartDoughnut, - IChartPropsChartLine, - IChartPropsChartPie, - IChartPropsChartRadar, - IChartPropsDataLabel, - IChartPropsDataTable, - IChartPropsLegend, - IChartPropsTitle, - ObjectNameProps, - OptsChartGridLine, - PositionProps { + IChartPropsAxisSer, + IChartPropsAxisVal, + IChartPropsBase, + IChartPropsChartBar, + IChartPropsChartDoughnut, + IChartPropsChartLine, + IChartPropsChartPie, + IChartPropsChartRadar, + IChartPropsDataLabel, + IChartPropsDataTable, + IChartPropsLegend, + IChartPropsTitle, + ObjectNameProps, + OptsChartGridLine, + PositionProps { /** * Alt Text value ("How would you describe this object and its contents to someone who is blind?") * - PowerPoint: [right-click on a chart] > "Edit Alt Text..." @@ -1663,15 +1671,15 @@ export interface SlideMasterProps { | { rect: {} } | { text: TextProps } | { - placeholder: { - options: PlaceholderProps - /** - * Text to be shown in placeholder (shown until user focuses textbox or adds text) - * - Leave blank to have powerpoint show default phrase (ex: "Click to add title") - */ - text?: string - } - } + placeholder: { + options: PlaceholderProps + /** + * Text to be shown in placeholder (shown until user focuses textbox or adds text) + * - Leave blank to have powerpoint show default phrase (ex: "Click to add title") + */ + text?: string + } + } )[] /** diff --git a/types/index.d.ts b/types/index.d.ts index e4e882e26..3a1290be8 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for pptxgenjs 3.11.0 +// Type definitions for pptxgenjs 3.12.0 // Project: https://gitbrent.github.io/PptxGenJS/ // Definitions by: Brent Ely // Michael Beaumont @@ -1081,80 +1081,80 @@ declare namespace PptxGenJS { * @default false */ bullet?: - | boolean - | { - /** - * Bullet type - * @default bullet - */ - type?: 'bullet' | 'number' - /** - * Bullet character code (unicode) - * @since v3.3.0 - * @example '25BA' // 'BLACK RIGHT-POINTING POINTER' (U+25BA) - */ - characterCode?: string - /** - * Indentation (space between bullet and text) (points) - * @since v3.3.0 - * @default 27 // DEF_BULLET_MARGIN - * @example 10 // Indents text 10 points from bullet - */ - indent?: number - /** - * Number type - * @since v3.3.0 - * @example 'romanLcParenR' // roman numerals lower-case with paranthesis right - */ - numberType?: - | 'alphaLcParenBoth' - | 'alphaLcParenR' - | 'alphaLcPeriod' - | 'alphaUcParenBoth' - | 'alphaUcParenR' - | 'alphaUcPeriod' - | 'arabicParenBoth' - | 'arabicParenR' - | 'arabicPeriod' - | 'arabicPlain' - | 'romanLcParenBoth' - | 'romanLcParenR' - | 'romanLcPeriod' - | 'romanUcParenBoth' - | 'romanUcParenR' - | 'romanUcPeriod' - /** - * Number bullets start at - * @since v3.3.0 - * @default 1 - * @example 10 // numbered bullets start with 10 - */ - numberStartAt?: number + | boolean + | { + /** + * Bullet type + * @default bullet + */ + type?: 'bullet' | 'number' + /** + * Bullet character code (unicode) + * @since v3.3.0 + * @example '25BA' // 'BLACK RIGHT-POINTING POINTER' (U+25BA) + */ + characterCode?: string + /** + * Indentation (space between bullet and text) (points) + * @since v3.3.0 + * @default 27 // DEF_BULLET_MARGIN + * @example 10 // Indents text 10 points from bullet + */ + indent?: number + /** + * Number type + * @since v3.3.0 + * @example 'romanLcParenR' // roman numerals lower-case with paranthesis right + */ + numberType?: + | 'alphaLcParenBoth' + | 'alphaLcParenR' + | 'alphaLcPeriod' + | 'alphaUcParenBoth' + | 'alphaUcParenR' + | 'alphaUcPeriod' + | 'arabicParenBoth' + | 'arabicParenR' + | 'arabicPeriod' + | 'arabicPlain' + | 'romanLcParenBoth' + | 'romanLcParenR' + | 'romanLcPeriod' + | 'romanUcParenBoth' + | 'romanUcParenR' + | 'romanUcPeriod' + /** + * Number bullets start at + * @since v3.3.0 + * @default 1 + * @example 10 // numbered bullets start with 10 + */ + numberStartAt?: number - // DEPRECATED + // DEPRECATED - /** - * Bullet code (unicode) - * @deprecated v3.3.0 - use `characterCode` - */ - code?: string - /** - * Margin between bullet and text - * @since v3.2.1 - * @deplrecated v3.3.0 - use `indent` - */ - marginPt?: number - /** - * Number to start with (only applies to type:number) - * @deprecated v3.3.0 - use `numberStartAt` - */ - startAt?: number - /** - * Number type - * @deprecated v3.3.0 - use `numberType` - */ - style?: string - } + /** + * Bullet code (unicode) + * @deprecated v3.3.0 - use `characterCode` + */ + code?: string + /** + * Margin between bullet and text + * @since v3.2.1 + * @deplrecated v3.3.0 - use `indent` + */ + marginPt?: number + /** + * Number to start with (only applies to type:number) + * @deprecated v3.3.0 - use `numberStartAt` + */ + startAt?: number + /** + * Number type + * @deprecated v3.3.0 - use `numberType` + */ + style?: string + } /** * Text color * - `HexColor` or `ThemeColor` @@ -1216,23 +1216,23 @@ declare namespace PptxGenJS { */ underline?: { style?: - | 'dash' - | 'dashHeavy' - | 'dashLong' - | 'dashLongHeavy' - | 'dbl' - | 'dotDash' - | 'dotDashHeave' - | 'dotDotDash' - | 'dotDotDashHeavy' - | 'dotted' - | 'dottedHeavy' - | 'heavy' - | 'none' - | 'sng' - | 'wavy' - | 'wavyDbl' - | 'wavyHeavy' + | 'dash' + | 'dashHeavy' + | 'dashLong' + | 'dashLongHeavy' + | 'dbl' + | 'dotDash' + | 'dotDashHeave' + | 'dotDotDash' + | 'dotDotDashHeavy' + | 'dotted' + | 'dottedHeavy' + | 'heavy' + | 'none' + | 'sng' + | 'wavy' + | 'wavyDbl' + | 'wavyHeavy' color?: Color } /** @@ -1901,6 +1901,8 @@ declare namespace PptxGenJS { */ export type ChartAxisTickMark = 'none' | 'inside' | 'outside' | 'cross' + export type ChartLineCap = 'flat' | 'round' | 'square' + export interface OptsChartData { /** * category labels @@ -1930,6 +1932,12 @@ declare namespace PptxGenJS { //color?: string // TODO: WIP: (Pull #727) } export interface OptsChartGridLine { + /** + * MS-PPT > Chart format > Format Major Gridlines > Line > Cap type + * - line cap type + * @default flat + */ + cap?: ChartLineCap /** * Gridline color (hex) * @example 'FF3399' @@ -1943,10 +1951,6 @@ declare namespace PptxGenJS { * Gridline style */ style?: 'solid' | 'dash' | 'dot' | 'none' - /** - * Line cap - */ - cap?: ChartLineCap } // TODO: 202008: chart types remain with predicated with "I" in v3.3.0 (ran out of time!) export interface IChartMulti { @@ -2182,8 +2186,17 @@ declare namespace PptxGenJS { dataNoEffects?: boolean holeSize?: number } - export type ChartLineCap = 'flat' | 'square' | 'round' export interface IChartPropsChartLine { + /** + * MS-PPT > Chart format > Format Data Series > Line > Cap type + * - line cap type + * @default flat + */ + lineCap?: ChartLineCap + /** + * Line dash type + * @default solid + */ lineDash?: 'dash' | 'dashDot' | 'lgDash' | 'lgDashDot' | 'lgDashDotDot' | 'solid' | 'sysDash' | 'sysDot' /** * MS-PPT > Chart format > Format Data Series > Marker Options > Built-in > Type @@ -2217,12 +2230,6 @@ declare namespace PptxGenJS { * @default 2 */ lineSize?: number - /** - * MS-PPT > Chart format > Format Data Series > Line > Cap type - * - line cap type - * @default flat - */ - lineCap?: ChartLineCap /** * MS-PPT > Chart format > Format Data Series > Line > Smoothed line * - "Smoothed line" @@ -2300,21 +2307,21 @@ declare namespace PptxGenJS { } export interface IChartOpts extends IChartPropsAxisCat, - IChartPropsAxisSer, - IChartPropsAxisVal, - IChartPropsBase, - IChartPropsChartBar, - IChartPropsChartDoughnut, - IChartPropsChartLine, - IChartPropsChartPie, - IChartPropsChartRadar, - IChartPropsDataLabel, - IChartPropsDataTable, - IChartPropsLegend, - IChartPropsTitle, - ObjectNameProps, - OptsChartGridLine, - PositionProps { + IChartPropsAxisSer, + IChartPropsAxisVal, + IChartPropsBase, + IChartPropsChartBar, + IChartPropsChartDoughnut, + IChartPropsChartLine, + IChartPropsChartPie, + IChartPropsChartRadar, + IChartPropsDataLabel, + IChartPropsDataTable, + IChartPropsLegend, + IChartPropsTitle, + ObjectNameProps, + OptsChartGridLine, + PositionProps { /** * Alt Text value ("How would you describe this object and its contents to someone who is blind?") * - PowerPoint: [right-click on a chart] > "Edit Alt Text..." @@ -2404,15 +2411,15 @@ declare namespace PptxGenJS { | { rect: {} } | { text: TextProps } | { - placeholder: { - options: PlaceholderProps - /** - * Text to be shown in placeholder (shown until user focuses textbox or adds text) - * - Leave blank to have powerpoint show default phrase (ex: "Click to add title") - */ - text?: string - } - } + placeholder: { + options: PlaceholderProps + /** + * Text to be shown in placeholder (shown until user focuses textbox or adds text) + * - Leave blank to have powerpoint show default phrase (ex: "Click to add title") + */ + text?: string + } + } )[] /** From ec96a37ab00e76295f7651ba93d35d72799868c1 Mon Sep 17 00:00:00 2001 From: Brent Ely Date: Sun, 22 Jan 2023 19:38:17 -0600 Subject: [PATCH 4/4] added new `cap` & `lineCap` props --- demos/modules/demo_chart.mjs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/demos/modules/demo_chart.mjs b/demos/modules/demo_chart.mjs index 14f76be45..ce3eccd3b 100644 --- a/demos/modules/demo_chart.mjs +++ b/demos/modules/demo_chart.mjs @@ -3,8 +3,8 @@ * AUTH: Brent Ely (https://github.com/gitbrent/) * DESC: Common test/demo slides for all library features * DEPS: Used by various demos (./demos/browser, ./demos/node, etc.) - * VER.: 3.11.0 - * BLD.: 20220806 + * VER.: 3.12.0 + * BLD.: 20230116 */ import { BASE_TABLE_OPTS, BASE_TEXT_OPTS_L, BASE_TEXT_OPTS_R, FOOTER_TEXT_OPTS, IMAGE_PATHS, TESTMODE } from "./enums.mjs"; @@ -890,8 +890,8 @@ function genSlide07(pptx) { valAxisMaxVal: 1, barDir: "bar", axisLabelFormatCode: "#%", - catGridLine: { color: "D8D8D8", style: "dash", size: 1 }, - valGridLine: { color: "D8D8D8", style: "dash", size: 1 }, + catGridLine: { color: "D8D8D8", style: "dash", size: 1, cap: "round" }, + valGridLine: { color: "D8D8D8", style: "dash", size: 1, cap: "square" }, catAxisLineShow: false, valAxisLineShow: false, barGrouping: "stacked", @@ -1018,6 +1018,7 @@ function genSlide10(pptx) { y: idx < 3 ? 0.5 : idx < 6 ? 2.85 : 5.1, w: 4.25, h: 2.25, + lineCap: 'round', lineDataSymbol: opt, lineDataSymbolSize: idx == 5 ? 9 : idx == 6 ? 12 : null, chartColors: COLORS_VIVID,