Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Seminar #200

Merged
merged 16 commits into from
Nov 12, 2024
Merged
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
2 changes: 1 addition & 1 deletion .github/conda/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ requirements:
- clingo>=5.6.0
- clorm>=1.4.1
- clingo-dl
- fastapi==0.103.*
- fastapi
- networkx
- uvicorn
- clingraph
Expand Down
2 changes: 1 addition & 1 deletion .github/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ conda:
- clingo>=5.6.0
- clorm>=1.4.1
- clingo-dl
- fastapi==0.103.*
- fastapi
- networkx
- uvicorn
- clingraph
Expand Down
4 changes: 2 additions & 2 deletions .github/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
clingo>=5.6.0
clorm>=1.4.1
clingo-dl
fastapi==0.103.*
fastapi
networkx
uvicorn
clingraph
Pillow
clingexplaid>=1.0.14
clingexplaid>=1.0.14
2 changes: 2 additions & 0 deletions .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ max-public-methods=20
max-returns=10
max-statements=50
min-public-methods=1
max-positional-arguments=7


[SIMILARITIES]

Expand Down
13 changes: 13 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# Changes

## clinguin 2.1.1

* Bug fix
* Menu bar fixed to top


## clinguin 2.0.1

* Bug fix
* Message elements now on top
* Docs
* Added documentation for mouse events

## clinguin 2.0.0


Expand Down
11 changes: 5 additions & 6 deletions angular_frontend/angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": 1,
"newProjectRoot": "projects",
"projects": {
"ClinGraphViz": {
"ClinguinAngular": {
"projectType": "application",
"schematics": {
"@schematics/angular:component": {
Expand Down Expand Up @@ -32,8 +32,7 @@
"styles": [
"src/styles.scss"
],
"scripts": [
]
"scripts": []
},
"configurations": {
"production": {
Expand Down Expand Up @@ -66,18 +65,18 @@
"builder": "@angular-devkit/build-angular:dev-server",
"configurations": {
"production": {
"browserTarget": "ClinGraphViz:build:production"
"browserTarget": "ClinguinAngular:build:production"
},
"development": {
"browserTarget": "ClinGraphViz:build:development"
"browserTarget": "ClinguinAngular:build:development"
}
},
"defaultConfiguration": "development"
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
"options": {
"browserTarget": "ClinGraphViz:build"
"browserTarget": "ClinguinAngular:build"
}
},
"test": {
Expand Down
4 changes: 2 additions & 2 deletions angular_frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"karma-chrome-launcher": "~3.2.0",
"karma-coverage": "~2.2.0",
"karma-jasmine": "~5.1.0",
"karma-jasmine-html-reporter": "~2.1.0",
"karma-jasmine-html-reporter": "~2.1.1",
"typescript": "~5.1.3"
}
}
}
6 changes: 3 additions & 3 deletions angular_frontend/src/app/app.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,16 @@ describe('AppComponent', () => {
expect(app).toBeTruthy();
});

it(`should have as title 'ClinGraphViz'`, () => {
it(`should have as title 'ClinguinAngular'`, () => {
const fixture = TestBed.createComponent(AppComponent);
const app = fixture.componentInstance;
expect(app.title).toEqual('ClinGraphViz');
expect(app.title).toEqual('ClinguinAngular');
});

it('should render title', () => {
const fixture = TestBed.createComponent(AppComponent);
fixture.detectChanges();
const compiled = fixture.nativeElement as HTMLElement;
expect(compiled.querySelector('.content span')?.textContent).toContain('ClinGraphViz app is running!');
expect(compiled.querySelector('.content span')?.textContent).toContain('ClinguinAngular app is running!');
});
});
4 changes: 0 additions & 4 deletions angular_frontend/src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ import { MenuBarComponent } from './menu-bar/menu-bar.component';
import { ButtonComponent } from './button/button.component';
import { CanvasComponent } from './canvas/canvas.component';
import { MessageComponent } from './message/message.component';
import { MainPageComponent } from './clingraphviz/main-page/main-page.component';
import { GraphOptionsComponent } from './clingraphviz/graph-options/graph-options.component';
import { ConfigService } from './config.service';
import { LocatorService } from './locator.service';
import { TextfieldComponent } from './textfield/textfield.component';
Expand Down Expand Up @@ -47,8 +45,6 @@ export function appConfigInit(appConfigService: ConfigService) {
ButtonComponent,
CanvasComponent,
MessageComponent,
MainPageComponent,
GraphOptionsComponent,
TextfieldComponent,
ModalComponent,
ContextMenuComponent,
Expand Down
3 changes: 3 additions & 0 deletions angular_frontend/src/app/callback-helper.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@ function handleRightClick(operation: string, event: Event) {


function handleUpdate(when: WhenDto, event: Event | null) {
console.log("---- Handling update", when)

let elementLookupService = LocatorService.injector.get(ElementLookupService)

let operation = when.operation
Expand Down Expand Up @@ -265,6 +267,7 @@ function handleCallback(when: WhenDto, event: Event | null) {
}

function handleContext(when: WhenDto, event: Event | null) {
console.log("---- Handling context", when)
let contextService = LocatorService.injector.get(ContextService)
let operation = when.operation
operation = replaceContext(operation)
Expand Down
37 changes: 1 addition & 36 deletions angular_frontend/src/app/canvas/canvas.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,8 @@ export class CanvasComponent {
let svgNodeElements = this.svgContainer.nativeElement.querySelectorAll(".node, .edge")
// let svgEdgeElements = this.svgContainer.nativeElement.querySelectorAll(".edge")

// console.log(svgNodeElements)
let nodeIdNodeElementLookup: { "key": string, "value": ElementDto }[] = []
element.children.forEach(child => {
// console.log(child)
let id_attr = this.attributeService.findAttribute("clingraph_id", child.attributes)

if (id_attr != null) {
Expand Down Expand Up @@ -99,25 +97,17 @@ export class CanvasComponent {

generateSvgNodeUiNodeAssociationList(svgNodeElements: any, nodeIdNodeElementLookup: { "key": string, "value": ElementDto }[]) {

// console.log(nodeIdNodeElementLookup)
let svgNodeUiNodeAssociationList: { "svg": HTMLElement, "ui": ElementDto }[] = []

svgNodeElements.forEach((svgNodeElement: HTMLElement) => {
// svgNodeElement.tooltip('hide')
let correspondingElementDtoNode: null | ElementDto = null
// console.error("----")
// console.error(svgNodeElement.id)
nodeIdNodeElementLookup.forEach((item: { "key": string, "value": ElementDto }) => {

if (svgNodeElement.id == item.key) {
correspondingElementDtoNode = item.value
} else {
// if (svgNodeElement.id.startsWith("edge")){
// key =
// }
for (const child of Array.from(svgNodeElement.children)) {
if (child.tagName == "title") {
// console.log(child.innerHTML)
if (child.innerHTML == item.key) {
correspondingElementDtoNode = item.value
}
Expand All @@ -131,7 +121,7 @@ export class CanvasComponent {
svgNodeUiNodeAssociationList.push({ "svg": svgNodeElement, "ui": correspondingElementDtoNode })

} else {
console.log("Warning: Could not find for the following svgElement a corresponding clingraph node or edge!")
console.debug("Warning: No svgElement defined for clingraph element", svgNodeElement.id)
}
})

Expand All @@ -145,32 +135,7 @@ export class CanvasComponent {
let clickRelatedDoList: WhenDto[] = []
this.callbackService.setCallbacks(elem.svg, elem.ui.when)

/*
uiElement.when.forEach((do_: WhenDto) => {
if (do_.actionType == "click") {
clickRelatedDoList.push(do_)
}
})

elem.svg.addEventListener("click",function(){
clickRelatedDoList.forEach((do_:WhenDto) => {
if (do_.interactionType == "update") {


let searchedElement : null | HTMLElement = document.getElementById(id)
if (searchedElement != null) {
if (key == "visibility") {
if (value == "hidden") {
searchedElement.style.visibility = "hidden"
} else if (value == "shown") {
searchedElement.style.visibility = "visible"
}
}
}
}
})
})
*/
})
}

Expand Down
16 changes: 0 additions & 16 deletions angular_frontend/src/app/clingraphviz/asptranslate.service.spec.ts

This file was deleted.

14 changes: 0 additions & 14 deletions angular_frontend/src/app/clingraphviz/asptranslate.service.ts

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading
Loading