Skip to content

Commit

Permalink
Merge branch 'master' into pr/420
Browse files Browse the repository at this point in the history
  • Loading branch information
gitbrent authored Jan 1, 2019
2 parents c92a5a9 + 268859d commit 704def0
Show file tree
Hide file tree
Showing 18 changed files with 406 additions and 322 deletions.
24 changes: 22 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,30 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]
### Coming In [3.0]: `save()` will return a Promise

## [2.4.0] - 2018-??-??

## [2.5.0] - 2018-12-??
### Added
- Added new chart options: `catAxisLabelFontBold`,`dataLabelFontBold`,`legendFontFace`,`valAxisLabelFontBold` [\#426](https://github.com/gitbrent/PptxGenJS/issue/426) ([BandaSatish07](https://github.com/BandaSatish07))
- Add missing jpg content type to fix corrupt presentation for Office365 [\#435](https://github.com/gitbrent/PptxGenJS/pull/435) ([antonandreyev](https://github.com/antonandreyev))
- Add `catAxisMinVal` and `catAxisMaxVal` [\#462](https://github.com/gitbrent/PptxGenJS/pull/462) ([vrimar](https://github.com/vrimar))
### Changed
- Remove legacy/deprecated attributes from README javascript script tags [\#431](https://github.com/gitbrent/PptxGenJS/pull/431) ([efx](https://github.com/efx))
- Fixed issue with SlideNumber `fontSize` float values [\#432](https://github.com/gitbrent/PptxGenJS/issue/432) ([efx](https://github.com/efx))
- Remove query and fragment from image URL extension [\#433](https://github.com/gitbrent/PptxGenJS/pull/433) ([katsuya-horiuchi](https://github.com/katsuya-horiuchi))
- Replace "$" with "jQuery" to fix integration issues with some applications [\#436](https://github.com/gitbrent/PptxGenJS/pull/436) ([antonandreyev](https://github.com/antonandreyev))
- Export more types to enhance TypeScript support [\#443](https://github.com/gitbrent/PptxGenJS/pull/443) ([ntietz](https://github.com/ntietz))
### Removed



## [2.4.0] - 2018-10-28
### Added
- Added support for SVG images [\#401](https://github.com/gitbrent/PptxGenJS/pull/401) ([Krelborn](https://github.com/Krelborn))
- Better detection/support for Angular [\#415](https://github.com/gitbrent/PptxGenJS/pull/415) ([antiremy](https://github.com/antiremy))
### Changed
- Demo page converted to Bootstrap CSS [gitbrent](https://github.com/gitbrent)
- Demo page converted to Bootstrap 4 [gitbrent](https://github.com/gitbrent)
- Fixed issue with float font-sizes in `addSlidesForTable()` [gitbrent](https://github.com/gitbrent)
- No Color on negative bars when barGrouping is stacked [\#343](https://github.com/gitbrent/PptxGenJS/issue/343)
([vanarebane](https://github.com/vanarebane)) [\#419](https://github.com/gitbrent/PptxGenJS/pull/419)
Expand All @@ -19,6 +37,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- X and Y table coordinates with value of zero ignored [\#411](https://github.com/gitbrent/PptxGenJS/pull/411) ([tovab](https://github.com/tovab))
- Placeholder left align property needs fixing [\#417](https://github.com/gitbrent/PptxGenJS/pull/417) ([raphael-trzpit](https://github.com/raphael-trzpit))
- Replace jquery each by standard forEach [\#418](https://github.com/gitbrent/PptxGenJS/pull/418) ([fdussert](https://github.com/fdussert))
- BugFix: 0 value plot points ignored on Scatter Chart [\#422](https://github.com/gitbrent/PptxGenJS/pull/422) ([ReimaFrgos](https://github.com/ReimaFrgos))
- Pass the callback as a function, rather than invoke it [\#424](https://github.com/gitbrent/PptxGenJS/pull/424) ([danielsiwiec](https://github.com/danielsiwiec))
### Removed


Expand Down
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
[![Open Source Love](https://badges.frapsoft.com/os/v1/open-source.svg?v=103)](https://github.com/ellerbrock/open-source-badge/) [![MIT Licence](https://img.shields.io/github/license/gitbrent/pptxgenjs.svg)](https://opensource.org/licenses/mit-license.php) [![npm version](https://img.shields.io/npm/v/pptxgenjs.svg)](https://www.npmjs.com/package/pptxgenjs) [![npm downloads](https://img.shields.io/npm/dm/pptxgenjs.svg)](https://www.npmjs.com/package/pptxgenjs)
[![MIT Licence](https://img.shields.io/github/license/gitbrent/pptxgenjs.svg)](https://opensource.org/licenses/mit-license.php) [![Known Vulnerabilities](https://snyk.io/test/npm/pptxgenjs/badge.svg)](https://snyk.io/test/npm/pptxgenjs) [![Package Quality](http://npm.packagequality.com/shield/pptxgenjs.png?style=flat-square)](https://github.com/gitbrent/pptxgenjs) [![npm downloads](https://img.shields.io/npm/dm/pptxgenjs.svg)](https://www.npmjs.com/package/pptxgenjs) [![jsdelivr downloads](https://data.jsdelivr.com/v1/package/gh/gitbrent/pptxgenjs/badge)](https://www.jsdelivr.com/package/gh/gitbrent/pptxgenjs)

# PptxGenJS

### JavaScript library that produces PowerPoint (pptx) presentations
## JavaScript library that creates PowerPoint presentations

Quickly and easily create PowerPoint presentations with a few simple JavaScript commands in client web browsers or Node desktop apps.

## Main Features
### Main Features
* Widely Supported: Creates and downloads presentations on all current web browsers (Chrome, Edge, Firefox, etc.) and IE11
* Full Featured: Slides can include Charts, Images, Media, Shapes, Tables and Text (plus Master Slides/Templates)
* Easy To Use: Entire PowerPoint presentations can be created in a few lines of code
* Modern: Pure JavaScript solution - everything necessary to create PowerPoint PPT exports is included

## Additional Features
### Additional Features
* Use the unique [HTML-to-PowerPoint](#html-to-powerpoint-feature) feature to copy an HTML table into 1 or more Slides with a single command

**************************************************************************************************
Expand Down Expand Up @@ -64,15 +64,15 @@ Use JavaScript to create a PowerPoint presentation with your web browser right n
## Client-Side
### Include Local Scripts
```javascript
<script lang="javascript" src="PptxGenJS/libs/jquery.min.js"></script>
<script lang="javascript" src="PptxGenJS/libs/jszip.min.js"></script>
<script lang="javascript" src="PptxGenJS/dist/pptxgen.js"></script>
<script src="PptxGenJS/libs/jquery.min.js"></script>
<script src="PptxGenJS/libs/jszip.min.js"></script>
<script src="PptxGenJS/dist/pptxgen.js"></script>
```
* IE11 support requires a Promises polyfill as well (included in the libs folder)

### Include Bundled Script
```javascript
<script lang="javascript" src="PptxGenJS/dist/pptxgen.bundle.js"></script>
<script src="PptxGenJS/dist/pptxgen.bundle.js"></script>
```
* Bundle script includes all libraries: jQuery + JSzip + PptxGenJS + Promises

Expand Down Expand Up @@ -170,7 +170,7 @@ include the `pptxgen.shapes.js` library.
The shapes file contains a complete PowerPoint Shape object array thanks to the [officegen project](https://github.com/Ziv-Barber/officegen).

```javascript
<script lang="javascript" src="PptxGenJS/dist/pptxgen.shapes.js"></script>
<script src="PptxGenJS/dist/pptxgen.shapes.js"></script>
```


Expand Down
4 changes: 2 additions & 2 deletions bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"dist/pptxgen.js"
],
"dependencies": {
"jquery": "^3.2.1",
"jszip": "^3.1.3"
"jquery": "^3.3.1",
"jszip": "^3.1.5"
},
"authors": [
"Brent Ely <https://github.com/gitbrent>"
Expand Down
4 changes: 2 additions & 2 deletions dist/pptxgen.bundle.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/pptxgen.bundle.js.map

Large diffs are not rendered by default.

91 changes: 47 additions & 44 deletions dist/pptxgen.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,96 +2,99 @@
// Project: https://gitbrent.github.io/PptxGenJS/
// Definitions by: Brent Ely <https://github.com/gitbrent/>
// Michael Beaumont <https://github.com/michaelbeaumont>
// Nicholas Tietz-Sokolsky <https://github.com/ntietz>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3

export as namespace PptxGenJS;

export = PptxGenJS;

declare class PptxGenJS {
// Presentation Props
getLayout(): string;
setBrowser(isBrowser: boolean): void;
setLayout(layout: PptxGenJS.LayoutName | PptxGenJS.Layout): void;
setRTL(isRTL: boolean): void;

// Presentation Metadata
setAuthor(author: string): void;
setCompany(company: string): void;
setRevision(revision: string): void;
setSubject(subject: string): void;
setTitle(title: string): void;

// Add a new Slide
addNewSlide(masterLayoutName?: string): PptxGenJS.Slide;
defineSlideMaster(opts: PptxGenJS.MasterSlideOptions): void;

// Export
save(exportFileName: string, callbackFunction?: Function, zipOutputType?: PptxGenJS.JsZipOutputType): void;
}

declare namespace PptxGenJS {
const version: string;
type ChartType = "AREA" | "BAR" | "BUBBLE" | "DOUGHNUT" | "LINE" | "PIE" | "RADAR" | "SCATTER";
type JsZipOutputType = "arraybuffer" | "base64" | "binarystring" | "blob" | "nodebuffer" | "uint8array";
type LayoutName = "LAYOUT_4x3" | "LAYOUT_16x9" | "LAYOUT_16x10" | "LAYOUT_WIDE";
interface Layout {
export type ChartType = "AREA" | "BAR" | "BUBBLE" | "DOUGHNUT" | "LINE" | "PIE" | "RADAR" | "SCATTER";
export type JsZipOutputType = "arraybuffer" | "base64" | "binarystring" | "blob" | "nodebuffer" | "uint8array";
export type LayoutName = "LAYOUT_4x3" | "LAYOUT_16x9" | "LAYOUT_16x10" | "LAYOUT_WIDE";
export interface Layout {
name: string;
width: number;
height: number;
}
type Color = string;
type Coord = number | string; // string is in form 'n%'
export type Color = string;
export type Coord = number | string; // string is in form 'n%'

interface CommonOptions {
export interface CommonOptions {
x?: Coord;
y?: Coord;
w?: Coord;
h?: Coord;
}
interface DataOrPath {
export interface DataOrPath {
// Exactly one must be set
data?: string;
path?: string;
}
interface ImageOptions extends CommonOptions, DataOrPath {
export interface ImageOptions extends CommonOptions, DataOrPath {
hyperlink?: string;
rounding?: boolean;
sizing?: "cover" | "contain" | "crop";
}

interface MediaOptions extends CommonOptions, DataOrPath {
export interface MediaOptions extends CommonOptions, DataOrPath {
onlineVideoLink?: string;
type?: "audio" | "online" | "video";
}

interface TextOptions extends CommonOptions, DataOrPath {
export interface TextOptions extends CommonOptions, DataOrPath {
align?: "left" | "center" | "right";
fontSize?: number;
color?: string;
valign?: "top" | "middle" | "bottom";
}

interface MasterSlideOptions {
export interface MasterSlideOptions {
title: string;
bkgd?: string | DataOrPath;
objects?: Object[];
objects?: object[];
slideNumber?: {x?: Coord, y?: Coord, color?: Color};
margin?: number | number[];
}

class Slide {
export class Slide {
// Slide Number methods
getPageNumber(): string;
slideNumber(): Object;
slideNumber(options: Object): void;
slideNumber(): object;
slideNumber(options: object): void;

// Core Object API Methods
addChart(type: ChartType, data: string, options?: Object): Slide;
// Core object API Methods
addChart(type: ChartType, data: string, options?: object): Slide;
addImage(options: ImageOptions): Slide;
addMedia(options: MediaOptions): Slide;
addNotes(noteText: string): Slide;
addShape(shapeName: string, options: Object): Slide;
addTable(tableData: Array<any>, options: Object): Slide;
addShape(shapeName: string, options: object): Slide;
addTable(tableData: Array<any>, options: object): Slide;
addText(textString: string, options: TextOptions): Slide;
}

class PptxGenJS {
// Presentation Props
getLayout(): string;
setBrowser(isBrowser: boolean): void;
setLayout(layout: LayoutName | Layout): void;
setRTL(isRTL: boolean): void;

// Presentation Metadata
setAuthor(author: string): void;
setCompany(company: string): void;
setRevision(revision: string): void;
setSubject(subject: string): void;
setTitle(title: string): void;

// Add a new Slide
addNewSlide(masterLayoutName?: string): Slide;
defineSlideMaster(opts: MasterSlideOptions): void;

// Export
save(exportFileName: string, callbackFunction?: Function, zipOutputType?: JsZipOutputType): void;
}
}

export = PptxGenJS.PptxGenJS;
Loading

0 comments on commit 704def0

Please sign in to comment.