Skip to content

Commit

Permalink
doc(ssd1306): update docstring for imageData
Browse files Browse the repository at this point in the history
having <canvas> in the string caused an actual Canvas element to be created in the docs :-P

also change the exported class name Ssd1306Element → SSD1306Element
  • Loading branch information
urish committed Apr 12, 2020
1 parent 8ffb5a9 commit bedd10e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ export { ResistorElement } from './resistor-element';
export { MembraneKeypadElement } from './membrane-keypad-element';
export { PotentiometerElement } from './potentiometer-element';
export { NeopixelMatrixElement } from './neopixel-matrix-element';
export { Ssd1306Element } from './ssd1306-element';
export { SSD1306Element } from './ssd1306-element';
13 changes: 7 additions & 6 deletions src/ssd1306-element.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@ import { customElement, html, LitElement, property, SVGTemplateResult } from 'li

type CanvasContext = CanvasRenderingContext2D | null | undefined;
@customElement('wokwi-ssd1306-element')
export class Ssd1306Element extends LitElement {
/** ImageData is the underlying pixel data of an area of a <canvas> element.
imageData can also be used to set a part of the canvas by using putImageData().
You may use the the redraw() method for initiating an update of the imageData data
which its reference wasn't changed.
export class SSD1306Element extends LitElement {
/**
* The pixel data to draw on the element's internal &lt;canvas&gt;.
* If you change the underlaying pixel data without updating the
* `imageData` reference, call the `redraw()` method to update the
* screen with your changes.
*/
@property() imageData: ImageData;

Expand Down Expand Up @@ -96,7 +97,7 @@ export class Ssd1306Element extends LitElement {
<text x="39" y="6">3v3</text>
<text x="58" y="6">Gnd</text>
</g>
<!--Star -->
<!-- Star -->
<path
d="M115.5 10.06l-1.59 2.974-3.453.464 2.495 2.245-.6 3.229 3.148-1.528 3.148 1.528-.6-3.23 2.495-2.244-3.453-.464-1.59-2.974z"
stroke="#FFF"
Expand Down

0 comments on commit bedd10e

Please sign in to comment.