oasis-open / cti-stix-visualization

OASIS TC Open Repository: Lightweight visualization for STIX 2.0 objects and relationships
http://oasis-open.github.io/cti-stix-visualization
BSD 3-Clause "New" or "Revised" License
138 stars 43 forks source link

Relationship labels misplaced in Firefox when using <base href="/"> #28

Open StephenThomson opened 6 years ago

StephenThomson commented 6 years ago

In Firefox, when using <base href="/"> the text labels for the relationships are placed at 0,0 on the canvas rather than on the arrow. This is because the xlink in the textPath is a relative link and if the base href is set to / ff will resolve the link relative to that.

<textPath xmlns:xlink="http://www.w3.org/1999/xlink" **xlink:href="#link_1"** startOffset="20%">indicates</textPath>

If you need to use the Visualiser in Angular there is a work around: remove <base href="/"> from index.html and then in app.module.ts add

import {APP_BASE_HREF} from '@angular/common';

@NgModule({
  declarations: [AppComponent],
  imports: [routing /* or RouterModule */], 
  providers: [{provide: APP_BASE_HREF, useValue : '/' }]
]); 

https://stackoverflow.com/questions/34535163/angular-2-router-no-base-href-set

gtback commented 6 years ago

Thanks, @StephenThomson . I've seen this behavior before, and thought I had made an issue for it, but I'm not finding it, so thanks for opening this.