@progress/kendo-drawing
Advanced tools
Comparing version 0.12.2 to 0.13.0
import { Element } from './shapes'; | ||
export class Observable { | ||
bind(eventName: string, handler: Function): Observable; | ||
@@ -10,7 +9,5 @@ one(eventName: string, handler: Function): Observable; | ||
unbind(eventName: string, handler?: any): Observable; | ||
} | ||
export class Surface extends Observable { | ||
options: SurfaceOptions; | ||
@@ -26,13 +23,4 @@ | ||
resize(force?: boolean): void; | ||
} | ||
export interface SurfaceTooltipCloseEvent { | ||
// TODO | ||
} | ||
export interface SurfaceTooltipOpenEvent { | ||
// TODO | ||
} | ||
export interface SurfaceOptions { | ||
@@ -76,2 +64,8 @@ type?: string; | ||
export interface SurfaceTooltipCloseEvent { | ||
// TODO | ||
} | ||
export interface SurfaceTooltipOpenEvent { | ||
// TODO | ||
} |
export * from './shapes'; | ||
export * from './alignment'; | ||
export * from './gradients'; | ||
export * from './core'; | ||
import * as pdf from './pdf'; | ||
import * as shapes from './shapes'; | ||
import { Group } from './shapes'; | ||
export class Promise { | ||
constructor(resolve?: any, reject?: any); | ||
then(resolve?: any, reject?: any): void; | ||
catch(reject?: any): void; | ||
} | ||
export function exportImage(group: shapes.Group, options?: any): Promise; | ||
export function exportSVG(group: shapes.Group, options?: any): Promise; | ||
export function drawDOM(element: HTMLElement, options?: shapes.PDFOptions): Promise; | ||
export { pdf }; | ||
export function exportImage(group: Group, options?: any): Promise<string>; | ||
export function exportSVG(group: Group, options?: any): Promise<string>; |
@@ -16,6 +16,3 @@ export * from './shapes'; | ||
import { drawDOM } from './html/core'; | ||
export { default as exportImage } from './canvas/export-image'; | ||
export { exportPDF } from './pdf/drawing'; | ||
export { default as exportSVG } from './svg/export-svg'; | ||
@@ -26,4 +23,5 @@ export { default as QuadNode } from './search/quad-node'; | ||
export { svg, canvas, drawDOM, util }; | ||
export { svg, canvas, util }; | ||
//# sourceMappingURL=drawing.js.map |
@@ -1,4 +0,9 @@ | ||
import * as drawing from './drawing'; | ||
import * as geometry from './geometry'; | ||
import * as pdf from './pdf'; | ||
export { drawing, geometry }; | ||
export { drawDOM } from './html'; | ||
export { exportPDF } from './pdf'; | ||
export * from './drawing'; | ||
export * from './core'; | ||
export { geometry, pdf }; |
import * as drawing from './drawing'; | ||
import * as geometry from './geometry'; | ||
import * as pdf from './pdf'; | ||
export * from './common'; | ||
export { drawDOM } from './html'; | ||
export { exportPDF } from './pdf'; | ||
export { exportImage, exportSVG } from './drawing'; | ||
export { | ||
animationFrame, Class, Color, htmlEncode, | ||
logToConsole, Observable, saveAs, support, | ||
template, throttle | ||
} from './common'; | ||
export { | ||
Animation, AnimationFactory, Arc, | ||
BaseNode, Circle, Element, Gradient, GradientStop, Group, | ||
Image, Layout, LinearGradient, MultiPath, ObserversMixin, | ||
OptionsStore, Path, PathParser, QuadNode, RadialGradient, | ||
Rect, ShapesQuadTree, Surface, SurfaceFactory, Text, | ||
align, fit, stack, vAlign, vStack, vWrap, wrap | ||
} from './drawing'; | ||
export { drawing, geometry, pdf }; | ||
//# sourceMappingURL=main.js.map |
@@ -1,6 +0,27 @@ | ||
import * as shapes from './shapes'; | ||
import { Group } from './shapes'; | ||
export interface PDFOptions { | ||
paperSize?: string | [ number | string, number | string ], | ||
margin?: string | number | { | ||
left?: number | string, | ||
top?: number | string, | ||
right?: number | string, | ||
bottom?: number | string | ||
}, | ||
landscape?: boolean, | ||
addMargin?: boolean, | ||
producer?: string, | ||
title?: string, | ||
author?: string, | ||
subject?: string, | ||
keywords?: string, | ||
creator?: string, | ||
date?: Date, | ||
multiPage?: boolean | ||
} | ||
export function exportPDF(group: Group, options: PDFOptions): Promise<string>; | ||
export function defineFont(definitions: any): void; | ||
export function saveAs(group: shapes.Group, filename: string, callback?: () => void): void; | ||
export function toDataURL(group: shapes.Group, callback: (data: string) => void): void; | ||
export function toBlob(group: shapes.Group, callback: (data: Blob) => void): void; | ||
export function saveAs(group: Group, filename: string, callback?: () => void): void; | ||
export function toDataURL(group: Group, callback: (data: string) => void): void; | ||
export function toBlob(group: Group, callback: (data: Blob) => void): void; |
@@ -9,4 +9,3 @@ /* eslint-disable no-multi-spaces, key-spacing, indent, camelcase, space-before-blocks, eqeqeq, brace-style */ | ||
import * as PDF from "./core"; | ||
import { Group, MultiPath } from '../shapes'; | ||
import { Gradient, RadialGradient } from '../gradients'; | ||
import { Group, MultiPath, Gradient, RadialGradient } from '../drawing'; | ||
import * as geo from "../geometry"; | ||
@@ -13,0 +12,0 @@ |
@@ -72,22 +72,2 @@ import { Transformation, Point, Circle as GeometryCircle, Arc as GeometryArc, Rect as GeometryRect } from './geometry'; | ||
export interface PDFOptions { | ||
paperSize?: string | [ number | string, number | string ], | ||
margin?: string | number | { | ||
left?: number | string, | ||
top?: number | string, | ||
right?: number | string, | ||
bottom?: number | string | ||
}, | ||
landscape?: boolean, | ||
addMargin?: boolean, | ||
producer?: string, | ||
title?: string, | ||
author?: string, | ||
subject?: string, | ||
keywords?: string, | ||
creator?: string, | ||
date?: Date, | ||
multiPage?: boolean | ||
} | ||
export interface GroupOptions { | ||
@@ -94,0 +74,0 @@ name?: string; |
{ | ||
"name": "@progress/kendo-drawing", | ||
"description": "Kendo UI Drawing API", | ||
"version": "0.12.2", | ||
"version": "0.13.0", | ||
"publishConfig": { | ||
@@ -13,5 +13,5 @@ "registry": "https://registry.npm.telerik.com" | ||
"main": "dist/npm/main.js", | ||
"module": "dist/es/main.js", | ||
"jsnext:main": "dist/es/main.js", | ||
"typings": "dist/es/main", | ||
"module": "main.js", | ||
"jsnext:main": "main.js", | ||
"typings": "main", | ||
"scripts": { | ||
@@ -22,2 +22,3 @@ "build-package": "gulp build-module", | ||
"lint": "gulp lint", | ||
"verify-npm": "gulp verify-npm", | ||
"semantic-release": "semantic-release pre && npm publish && semantic-release post" | ||
@@ -24,0 +25,0 @@ }, |
@@ -1,77 +0,13 @@ | ||
# Kendo UI Drawing API | ||
# Kendo UI for Angular 2: Drawing | ||
This repository contains the source code and documentation of the Kendo UI Drawing package. | ||
* [Overview](http://www.telerik.com/kendo-angular-ui/components/drawing/) | ||
It is a cross-browser vector graphics library. It offers a simple object model for building and manipulating visual scenes. | ||
## Overview | ||
## Basic Usage | ||
This is the Kendo UI Drawing package, part of the [Kendo UI for Angular 2](http://www.telerik.com/kendo-angular-ui/) suite. | ||
You build a scene by creating drawing elements such as curves, images, and text. Scene elements are live and respond to changes of their appearance and geometry. | ||
The package currently includes the Drawing library. | ||
A drawing surface is used to render scenes on and off screen. Surfaces encapsulate specific browser technologies such as SVG or Canvas. | ||
## Basic Usage and Installation | ||
To draw a visual scene, add a HTML element to the page that will serve as the surface container: | ||
```html | ||
<div id="container" style="position: relative; width: 600px; height: 400px;"></div> | ||
``` | ||
create the drawing shapes that build the scene: | ||
```javascript | ||
import { geometry as geom } from '@progress/kendo-drawing'; | ||
import { drawing as draw } from '@progress/kendo-drawing'; | ||
const geometry = new geom.Circle([100, 100], 100); | ||
const circle = new draw.Circle(geometry); | ||
``` | ||
create the surface and draw the shapes: | ||
```javascript | ||
const surface = draw.Surface.create(document.getElementById("container")); | ||
surface.draw(circle); | ||
``` | ||
## Installation | ||
The Drawing API is published as a [scoped NPM package](https://docs.npmjs.com/misc/scope) in the [NPMJS Telerik account](https://www.npmjs.com/~telerik). | ||
Install it using NPM. | ||
```bash | ||
npm install --save '@telerik/kendo-drawing'; | ||
``` | ||
Once installed, import the drawing and geometry elements that you require. | ||
```javascript | ||
// ES2015 module syntax | ||
import { Circle, Surface } from '@telerik/kendo-drawing/drawing'; | ||
//or | ||
import { Point, Circle as GeometryCircle } from '@telerik/kendo-drawing/geometry'; | ||
``` | ||
```javascript | ||
// CommonJS format | ||
var drawing = require('@telerik/kendo-drawing').drawing; | ||
//or | ||
var geometry = require('@telerik/kendo-drawing').geometry; | ||
``` | ||
> To install the npm package, it is recommended that you use Node.js 5.0.0 or later versions. | ||
### Browser Support | ||
- Google Chrome | ||
- Firefox | ||
- Safari (OS X) | ||
- Safari (iOS) | ||
- Chrome (Android) | ||
- IE(9+)/Edge | ||
For more information on how to install the Drawing library, refer to the [documentation](http://www.telerik.com/kendo-angular-ui/components/drawing/). |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
2872056
372
26865
14