Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@progress/kendo-drawing

Package Overview
Dependencies
Maintainers
0
Versions
216
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@progress/kendo-drawing

Kendo UI Drawing

  • 1.21.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
0
Created

What is @progress/kendo-drawing?

@progress/kendo-drawing is a powerful library for creating and manipulating vector graphics in web applications. It provides a rich API for drawing shapes, paths, and text, as well as for applying transformations and styles. The library is part of the Kendo UI suite and is designed to work seamlessly with other Kendo UI components.

What are @progress/kendo-drawing's main functionalities?

Drawing Shapes

This feature allows you to draw basic shapes like circles, rectangles, and ellipses. The code sample demonstrates how to create a circle with a specific stroke and fill color.

const draw = require('@progress/kendo-drawing');
const surface = draw.Surface.create(document.getElementById('surface'));
const circle = new draw.Circle(new draw.geometry.Circle([100, 100], 50), {
  stroke: {
    color: '#000',
    width: 2
  },
  fill: {
    color: '#ff0000'
  }
});
surface.draw(circle);

Drawing Paths

This feature allows you to draw complex paths by defining a series of points and lines. The code sample demonstrates how to create a path with multiple line segments.

const draw = require('@progress/kendo-drawing');
const surface = draw.Surface.create(document.getElementById('surface'));
const path = new draw.Path({
  stroke: {
    color: '#000',
    width: 2
  }
});
path.moveTo(10, 10).lineTo(100, 100).lineTo(200, 50);
surface.draw(path);

Applying Transformations

This feature allows you to apply transformations such as rotation, scaling, and translation to shapes. The code sample demonstrates how to rotate a rectangle around a specific point.

const draw = require('@progress/kendo-drawing');
const surface = draw.Surface.create(document.getElementById('surface'));
const rect = new draw.Rect(new draw.geometry.Rect([50, 50], [100, 100]), {
  stroke: {
    color: '#000',
    width: 2
  },
  fill: {
    color: '#00ff00'
  }
});
rect.transform(draw.transform().rotate(45, [100, 100]));
surface.draw(rect);

Styling Elements

This feature allows you to style elements such as text and shapes with various properties like font, color, and stroke. The code sample demonstrates how to style a text element.

const draw = require('@progress/kendo-drawing');
const surface = draw.Surface.create(document.getElementById('surface'));
const text = new draw.Text('Hello, World!', [50, 50], {
  font: 'bold 20px Arial',
  fill: {
    color: '#0000ff'
  }
});
surface.draw(text);

Other packages similar to @progress/kendo-drawing

Keywords

FAQs

Package last updated on 18 Nov 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc