@webwriter/neural-network
Version:
Deep learning visualization for feed-forward networks with custom datasets, training and prediction.
50 lines (42 loc) • 1.4 kB
text/typescript
import { LitElementWw } from '@webwriter/lit'
import { CSSResult, TemplateResult, html } from 'lit'
import { customElement, property } from 'lit/decorators.js'
import { globalStyles } from '@/global_styles'
import type { CNeuron } from '@/components/network/neuron'
import { CCard } from '../reusables/c-card'
import { CNetworkLink } from '../reusables/c-network-link'
import { msg } from '@lit/localize'
export class EdgeInfoCard extends LitElementWw {
static scopedElements = {
'c-card': CCard,
'c-network-link': CNetworkLink,
}
({ attribute: false })
accessor source: CNeuron
({ attribute: false })
accessor target: CNeuron
// STYLES - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
static styles: CSSResult = globalStyles
// RENDER - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
render(): TemplateResult<1> {
return html`
<c-card>
<div slot="title">${msg('Edge')}</div>
<div slot="content">
<p>
From:
<c-network-link .target="${this.source}"
>${this.source.getName()}</c-network-link
>
</p>
<p>
To:
<c-network-link .target="${this.target}"
>${this.target.getName()}</c-network-link
>
</p>
</div>
</c-card>
`
}
}