npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@eqproject/eqp-img-drawing

v3.0.0

Published

Component to draw on images

Downloads

16

Readme

Table of contents

Getting started

This component allows to draw on pictures and export the result as a Blob. Is is based on the use of fabric.js.

Step 1: Install eqp-attachments and fabric:

npm install --save @eqproject/eqp-img-drawing
npm install [email protected]

Step 2:

Import the EqpImgDrawingModule:

import { EqpImgDrawingModule } from '@eqproject/eqp-img-drawing';

@NgModule({
  declarations: [AppComponent],
  imports: [EqpImgDrawingModule],
  bootstrap: [AppComponent]
})
export class AppModule {}

API

Inputs

| Input | Type | Default | Required | Description | | - | - | - | - | - | | [src] | string| null | yes | Image url or base64 string | | [i18n] | I18nInterface? | 'I18nEn' | no | Text labels to use | | [outputMimeType] | string? | null | no | Mime type of the output image | | [outputQuality] | number? | null | no | Number between 0 and 1 to determine the quality of the ouput image | | [loadingTemplate] | TemplateRef<any>? | null | no | Template shown while loading | | [errorTemplate] | TemplateRef<any>? | null | no | Template shown in case of error | | [enableTooltip] | boolean? | false | no | Enable/disable tooltip for toolbar buttons/actions | | [tooltipLanguage] | string? | 'en' | no | Language of tooltip (en or fr) | | [width] | number? | null | Yes if no src provided | Width of the canvas | | [height] | number? | null | Yes if no src provided | Height of the canvas | | [forceSizeCanvas] | boolean| true | no | Force the canvas to width and height of image or with those specified | | [forceSizeExport] | boolean| false | no | Force the exported image to width and height with those specified | | [borderCss] | string? | 'none' | no | Add a border to the canvas in CSS (example: 1px solib black) | | [enableRemoveImage] | boolean| false | no | Enable the option to remove the image loaded | | [enableLoadAnotherImage] | boolean| false | no | Enable the option to load another image | | [showCancelButton] | boolean| true | no | Enable the cancel button | | [colors] | { [name: string]: string } | { black: '#000', white: '#fff', yellow: '#ffeb3b', red: '#f44336', blue: '#2196f3', green: '#4caf50', purple: '#7a08af' } | no | Colors available for users | | [drawingSizes] | { [key: string]: number }? | { small: 5, medium: 10, large: 25 } | no | Sizes available for users |

Outputs

| Output | Event Arguments | Required | Description | | ------------- | ------------- | ------------- | ------------- | | (save) | EventEmitter<Blob> | no | Invoked on save button click, use $event to get the Blob of the new edited image | | (cancel) | EventEmitter<void> | no | Invoked on cancel button click |

Use cases

<eqp-img-drawing [showCancelButton]="false" [enableLoadAnotherImage]="true" [enableRemoveImage]="true"
    [src]="src" (save)="saveBtn($event)" [i18n]="i18n" [locale]="locale" 
    [drawingSizes]="{ small: 5, medium: 10, large: 25, extra: 50 }">
</eqp-img-drawing>
    import { I18nInterface } from 'projects/eqp-img-drawing/src/public-api';
    
    ...
    
    i18n: I18nInterface = {
        saveBtn: 'Salva immagine',
        sizes: {
            extra: 'Extra'
        }
    };
    src: string = 'https://images.unsplash.com/photo-1565199953730-2ea3b119ae22?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=700&q=80';
   
   ...
   
    saveBtn(event) {
        console.log(event)
    }

Credits

This library has been developed by EqProject SRL, for more info contact: [email protected]