plotly / plotly/angular-plotly.js

Impossible to set layout width in %

Offen
#203 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Vorherrschende Sprache
TypeScript
Sterne
242
Forks
81
Ø Merge
8 Std. 48 Min.
Gemergte PRs (30 T.)
18

Beschreibung

Hello,

In my case i updated angular and figured that witdh of my <plotly-plot> is now fixed to 700px.
My graph is displayed in a sidenav, and the 700px is higher than the sidenav width.

Also this is not working in html :
<plotly-plot [style]="{ width: '100%', height: '220px' }" ...></plotly-plot>

The height is correctly set but width:100% is totaly ignored as it's not valid value in px and the default value 700px stay.

Another thing is that after a window resize or a graph axis moove all is correctly set again and graph fit to the container.
So it is just about the first render forcing to 700px;

I used a temporary trick to make the graph fit properly.

  • An event is triggered when the sidenav is opened, this event sets a boolean "displayGraph" to true.
  • This boolean is then used to display the graph via a *ngIf="displayGraph"

Best regards,
CUETO Vincent

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginne am -Einstiegspunkt und reproduziere das erste Rendering innerhalb einer sidenav mit width: 100% und einer festen Höhe. Verfolge, warum das anfängliche Layout 700px verwendet, während eine Größenänderung oder das Verschieben der Achse dies korrigiert; abgeschlossen ist es, wenn die prozentuale Breite beim ersten Rendering berücksichtigt wird, ohne die displayGraph-Umgehungslösung.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
angular, typescript
Bereich
frontend, web-dev
Issue-Typ
Bug
Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.