WIP VOWL notation for owl#78
Conversation
|
@toefl Thanks, I'll look at the changes shortly. |
|
I deleted the commented code sections. |
yuricus
left a comment
There was a problem hiding this comment.
Please see comments in files.
| "id": "http://ailab.ifmo.ru/dialog/tv/schema#Router", | ||
| "types": [ | ||
| "http://www.w3.org/2002/07/owl#Class" | ||
| "http://www.w3.org/2002/07/owl#Thing" |
There was a problem hiding this comment.
Why do you need to change default example? Do you need it to demo something? I expect there are enough classes in this example to showcase visualization customization.
There was a problem hiding this comment.
I wanted to experiment with the data. Returned as it was
|
|
||
| const CLASS_NAME = 'ontodia-big-icon-owl_template'; | ||
|
|
||
| export class BigIconTemplateOwl extends Component<TemplateProps, {}> { |
There was a problem hiding this comment.
Since you're providing templates for OWL/VOWL notation please name templates and files appropriately. For example, VOWLClassTemplate, VOWLPropertyTemplate, etc.
| view: DiagramView; | ||
| } | ||
|
|
||
| export class ElementLayerOwl extends React.Component<Props, void> { |
There was a problem hiding this comment.
Do you really need to clone this class? Maybe there is some other way?
There was a problem hiding this comment.
No, I'll try differently later
There was a problem hiding this comment.
done without clone class ElementLayer
| @@ -0,0 +1,35 @@ | |||
| .ontodia-overlayed-owl_element { | |||
There was a problem hiding this comment.
You don't need to copy every css class, with scss you can easily use existing ones and override only properties you need.
|
|
||
| import { TemplateProps } from '../props'; | ||
|
|
||
| const CLASS_NAME = 'ontodia-VOWLClass_template'; |
There was a problem hiding this comment.
Please, use consistent naming for CSS classes: ontodia-vowl-class-template
|
|
||
| const CLASS_NAME = 'ontodia-VOWLDatatypeObjectProperty_template'; | ||
|
|
||
| export class VOWLDatatypeObjectPropertyTemplate extends Component<TemplateProps, {}> { |
There was a problem hiding this comment.
I think the better name for this template would be just VowlPropertyTemplate and corresponding CSS class ontodia-vowl-property-template.
| const CLASS_NAME = 'ontodia-VOWLDatatypeObjectProperty_template'; | ||
|
|
||
| export class VOWLDatatypeObjectPropertyTemplate extends Component<TemplateProps, {}> { | ||
| public SetColor(types: any) : string { |
There was a problem hiding this comment.
This method should be private and called getColor (because it doesn't actually set anything).
Also consider changing the type of types parameter to string.
|
|
||
| import { TemplateProps } from '../props'; | ||
|
|
||
| const CLASS_NAME = 'ontodia-default-owl_template'; |
There was a problem hiding this comment.
-> ontodia-default-owl-template
|
|
||
| const CLASS_NAME = 'ontodia-default-owl_template'; | ||
|
|
||
| export class DefaultElementTemplateOwl extends React.Component<TemplateProps, {}> { |
There was a problem hiding this comment.
DefaultElementTemplateOwl -> DefaultOwlTemplate
|
|
||
| var divStyle; | ||
| if ( window.location.href == "http://localhost:10444/vowl.html" ) | ||
| divStyle = {position: 'absolute', transform, borderStyle: "solid", borderWidth: '1px', borderRadius: '15px', borderColor: "grey", padding: '5px'} |
There was a problem hiding this comment.
I think the better way to add this styles is to specify them in .scss for VOWL templates.
There was a problem hiding this comment.
I was asked not to clone this class for vowl. Therefore, it remains the same. Depending on the values in the select I override the necessary properties for ElementLayer.
I leave without changes.
There was a problem hiding this comment.
This module (elementLayer) shouldn't contain any domain-related logic, especially like overriding styles for specific URIs (it also wouldn't work on any other deployment URI, so it isn't a good idea anyway).
Instead, a right way to do this is to add this styles directly to VOWL-related templates' scss-styles, so they could work in any environment.
|
|
||
| const CLASS_NAME = 'ontodia-VOWLClass_template'; | ||
|
|
||
| export class VOWLClassTemplate extends Component<TemplateProps, {}> { |
There was a problem hiding this comment.
VOWLClassTemplate -> VowlClassTemplate
| import { DefaultTypeStyleBundle } from '../customization/defaultTypeStyles'; | ||
| import { DefaultLinkTemplateBundle } from '../customization/defaultLinkStyles'; | ||
| import { DefaultElementTemplate, DefaultTemplateBundle } from '../customization/templates'; | ||
| import { DefaultElementTemplateOwl, DefaultTemplateBundle } from '../customization/templates'; |
There was a problem hiding this comment.
These changes should be unnecessary (see comments for stc/ontodia/customization/templates/index.ts).
There was a problem hiding this comment.
I do not understand how to satisfy your remarks. I need help
|
|
||
| const CLASS_NAME = 'ontodia-toolbar'; | ||
|
|
||
|
|
There was a problem hiding this comment.
Please, discard all unnecessary whitespace / formatting changes here.
| } | ||
| } | ||
|
|
||
| .ontodia-VOWLDatatypeObjectProperty_template_body { |
There was a problem hiding this comment.
Use SASS nested selectors for styles here, e.g.:
.ontodia-vowl-property-template {
&__body {
...
}
&__body-type-line {
...
}
}
|
I use the automatic formatting of the code by means of VisualCode. I think it will not be a problem. |
|
I recommend to install TSLint extension for VSCode to see all style warnings directly in the editor. |
| @@ -0,0 +1,73 @@ | |||
| import * as React from 'react'; | |||
There was a problem hiding this comment.
Please rename this file to VowlClass.tsx to match component's name.
|
|
||
| const CLASS_NAME = 'ontodia-vowl-property-template'; | ||
|
|
||
| export class vowlPropertyTemplate extends Component<TemplateProps, {}> { |
There was a problem hiding this comment.
Class names usually start with uppercase character: vowlPropertyTemplate -> VowlPropertyTemplate.
Also don't forget to rename the file itself (to vowlProperty.tsx).
| types.indexOf('http://xmlns.com/foaf/0.1/Organization') !== -1 | ||
| ) { | ||
| return OrganizationTemplate; | ||
| if (window.location.href === 'http://localhost:10444/vowl.html') { |
There was a problem hiding this comment.
It would be better to create separate VowlTemplateBundle like this instead:
export const VowlTemplateBundle: TemplateResolver[] = [
types => {
// Use new templates here
if (types.indexOf('http://www.w3.org/2000/01/rdf-schema#Class') !== -1) {
return VowlClassTemplate;
} ...
}
]
and then just import and use this bundle instead in the src/examples/demoOwl.ts:
import { VowlTemplateBundle } from '../index';
...
const props: WorkspaceProps & ClassAttributes<Workspace> = {
...
viewOptions: {
linkTemplateResolvers: ...
templatesResolvers: VowlTemplateBundle,
}
}
There was a problem hiding this comment.
VowlTemplateBundle has been added
| viewOptions: { | ||
| linkTemplateResolvers: [ | ||
| type => { | ||
| if (type.indexOf('subClassOf') !== -1) |
There was a problem hiding this comment.
Always use braces for block statements:
if (type.indexOf('subClassOf') !== -1) {
return CUSTOM_LINK_TEMPLATE_SUBCLASSOF;
} else {
return CUSTOM_LINK_TEMPLATE;
}
| const CLASS_NAME = 'ontodia-default-owl-template'; | ||
|
|
||
| export class DefaultOwlTemplate extends React.Component<TemplateProps, {}> { | ||
| private GetColor(types: string): string { |
There was a problem hiding this comment.
In javascript (and typescript) methods' names (and other functions' names in general) usually starts with lower-case character, e.g.:
private getColor(types: string): string { ... }
public isThing(types: any): boolean { ... }
| padding-right: 10px; | ||
| } | ||
|
|
||
| .link.joint-theme-default:hover { |
There was a problem hiding this comment.
Put this style change into CUSTOM_LINK_TEMPLATE or CUSTOM_LINK_TEMPLATE_SUBCLASSOF instead of globally overriding style for all links.
| overflow: hidden; | ||
| padding: 7px 10px 0px 10px; | ||
| &:hover | ||
| { |
There was a problem hiding this comment.
Please move this brace to the previous line.
| <div className={CLASS_NAME}> | ||
| <div className={`${CLASS_NAME}__main-part`}> | ||
| <div className='ontodia-vowl-class-template_body'> | ||
| <div style={{flexGrow: 1, overflow: 'hidden', textOverflow: 'ellipsis'}}> |
There was a problem hiding this comment.
Please, extract all inline styles for elements in markup for this template into corresponding scss file.
| @@ -0,0 +1,182 @@ | |||
| .ontodia-default-owl-template { | |||
There was a problem hiding this comment.
Please rename this file to _defaultOwl.scss to match component's name.
| @@ -0,0 +1,132 @@ | |||
| .ontodia-vowl-property-template { | |||
There was a problem hiding this comment.
Please rename this file to _vowlProperty.scss to match component's name.
Fix styles of the links labels
* Add pointer callbacks to the API * Fix displaying the spinner
- support element nesting (grouping) through EmbeddedLayer; - import data from outside to RDFDataProvider; - merge statistics in composite data provider.
Nested nodes
…n Ontodia. Now uri2name was improved so it's more difficult to get empty label.
Remove the uri2name from rdf/sparql data providers and check labels
- workaround bug when parser encounters rdf:parseType="Collection"; - support blank nodes; - imporove guessing file type by extension; - throw errors with more detailed messages; - fix initialization data race issues; - use async/await for implementation.
…105) * Fixed default OWL/RDFS SPARQL config to display only links user can navigate * Updated configuration to support blank nodes.
No description provided.