9von10 / ngx-cytoscapejs

Angular 13+ Cytoscape.js Wrapper
MIT License
16 stars 5 forks source link

Is this project actively maintained? does it work with Angular 18? #20

Closed FrancescoBorzi closed 2 weeks ago

FrancescoBorzi commented 1 month ago

Greetings and first of all thanks for developing this application and making it open-source.

I'm considering using this library for a work project where we have Angular and already use cytoscape. My only concern is making sure this is regularly up to date.

We currently use Angular 17 and plan to move soon to Angular 18, I was wondering if you already support Angular 18 (I don't see it in the readme) and if you plan to actively update this library in the future to make sure it is compatible with the latest Angular version.

9von10 commented 1 month ago

Hello Francesco,

thank you for your issue and your interest in ngx-cytoscapejs!

The library is currently working with Angular 18 but you must use the manual installation steps described in the README as the ng-add command throws a dependency error. When using standalone components you have to import the module using the "importProvidersFrom" function from "@angular/core":

// app.config.ts
import { CytoscapejsModule } from 'ngx-cytoscapejs';

export const appConfig: ApplicationConfig = {
  providers: [
    provideZoneChangeDetection({ eventCoalescing: true }),
    provideRouter(routes),
    importProvidersFrom(CytoscapejsModule),
  ],
};

Afterwards you can import the module in your standalone component and use the ngx-cytoscapejs component as intended:

// app.component.ts
@Component({
  selector: 'app-root',
  standalone: true,
  imports: [RouterOutlet, CytoscapejsModule],
  templateUrl: './app.component.html',
  styleUrl: './app.component.scss',
})
<!-- app.component.html -->
<div class="full-height">
  <cytoscapejs
    [cytoscapeOptions]="cytoscapeOptions"
    [autoFit]="true"
    [applyCxBackgroundColor]="true"
  ></cytoscapejs>
</div>

<router-outlet />

As for regular updates: I'm planing to keep the library in sync with major Angular releases but will not add new features to it. Because I'm working on this project in my free time it might take some time before an upgrade on my end will be released. Currently I'm working on updating the library to Angular 18 and switching to standalone.

Best regards Remo

FrancescoBorzi commented 1 month ago

@9von10 thank you very much for your answer! I'm glad to hear you plan to maintain ngx-cytoscapejs, I will try using this library in my project.

eboukamza commented 3 weeks ago

CytoscapejsModule has been removed from 1.8.0

See demo app

9von10 commented 3 weeks ago

Hi @eboukamza ,

since version 1.8.0 the library is standalone and modules are therefore not needed anymore.

If you want to use the library with a module based Angular 18 app you can simply import the component into your module.