Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ For a full description of Plotly chart types and attributes see the following re
### Basic Props

| Prop | Type | Default | Description |
| -------------------------- | ---------------------------- | ------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|----------------------------| ---------------------------- | ------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `[data]` | `Array` | `[]` | list of trace objects (see https://plot.ly/javascript/reference/) |
| `[layout]` | `Object` | `undefined` | layout object (see https://plot.ly/javascript/reference/#layout) |
| `[frames]` | `Array` | `undefined` | list of frame objects (see https://plot.ly/javascript/reference/) |
Expand All @@ -114,7 +114,7 @@ For a full description of Plotly chart types and attributes see the following re
| `(error)` | `Function(err)` | `undefined` | Callback executed when a plotly.js API method rejects |
| `[divId]` | `string` | `undefined` | id assigned to the `<div>` into which the plot is rendered. |
| `[className]` | `string` | `undefined` | applied to the `<div>` into which the plot is rendered |
| `[style]` | `Object` | `{position: 'relative', display: 'inline-block'}` | used to style the `<div>` into which the plot is rendered |
| `[innerStyle]` | `Object` | `{position: 'relative', display: 'inline-block'}` | used to style the `<div>` into which the plot is rendered |
| `[debug]` | `Boolean` | `false` | Assign the graph div to `window.gd` for debugging |
| `[useResizeHandler]` | `Boolean` | `false` | When true, adds a call to `Plotly.Plot.resize()` as a `window.resize` event handler |

Expand All @@ -125,7 +125,7 @@ For a full description of Plotly chart types and attributes see the following re
selector: 'plotly-example',
template: `
<plotly-plot [data]="graph.data" [layout]="graph.layout"
[useResizeHandler]="true" [style]="{position: 'relative', width: '100%', height: '100%'}">
[useResizeHandler]="true" [innerStyle]="{position: 'relative', width: '100%', height: '100%'}">
</plotly-plot>`,
})
export class PlotlyExampleComponent {
Expand Down
9 changes: 5 additions & 4 deletions projects/plotly/src/lib/plotly.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,10 @@ import { Plotly } from './plotly.interface';
selector: 'plotly-plot',
standalone: true,
imports: [CommonModule],
template: `<div #plot [attr.id]="divId()" [ngClass]="getClassName()" [ngStyle]="style()">
<ng-content></ng-content>
</div>`,
template: `
<div #plot [attr.id]="divId()" [ngClass]="getClassName()" [ngStyle]="innerStyle()">
<ng-content></ng-content>
</div>`,
providers: [PlotlyService],
})
export class PlotlyComponent implements OnInit, OnChanges, OnDestroy, DoCheck {
Expand All @@ -47,7 +48,7 @@ export class PlotlyComponent implements OnInit, OnChanges, OnDestroy, DoCheck {
layout = input<Partial<Plotly.Layout>>();
config = input<Partial<Plotly.Config>>();
frames = input<Partial<Plotly.Config>[]>();
style = input<{ [key: string]: string }>();
innerStyle = input<{ [key: string]: string }>();

divId = input<string>();
revision = input(0);
Expand Down