@likec4/core
Advanced tools
Changelog
1.12.0 (2024-10-07)
dsl: params to adjust autolayout (thanks @pavelpykhtin, #1053)
view {
include *
autoLayout LeftRight 120 110
}
dsl: add Azure iconset (thanks @msisolak #1040)
publish extension to Open VSX (thanks @davydkov, #908)
VITE_KROKI_D2_SVG_URL
(thanks @davydkov, #1060)--enable-source-maps
in node extension (eef8153)Changelog
1.11.0 (2024-09-24)
Relationship details
On hover displays direct relationships and resolved from nested. If relationship has navigateTo
- displays navigation link
To disable - set showRelationshipDetails={false}
in react component
Improved layout editing
Thanks to @pavelpykhtin, now it is possible add control points with right click, or reset all control points
Example here #1013
New API LikeC4Model.Layouted
Difference between LikeC4Model.Computed
and LikeC4Model.Layouted
- is that second one also includes layout data (dimensions, positions), that is needed for rendering
import { LikeC4 } from 'likec4'
const likec4 = await LikeC4.fromWorkspace()
// Sync and fast
const model = likec4.computedModel()
model
.element('cloud.backend.api')
.incoming() // relationships incoming to the element
.filter(r => r.tags.includes('http')) // filter by tags
.map(r => r.source) // get source elements
// Async, includes layout data (dimensions, positions...)
const diagram = await likec4.layoutedModel().view('index')
Generated React component also exports instance of LikeC4Model.Layouted
, and hooks to use inside your app.
Changelog
1.10.1 (2024-09-17)
Changelog
1.10.0 (2024-09-12)
Parallel steps and notes in dynamic views
<img width="661" alt="image" src="https://github.com/user-attachments/assets/8454d296-6ffe-4ea2-a9d8-0d72aff70105"> [Playground example](https://playground.likec4.dev/w/dynamic/)Navigation for relationships (zoom-in to dynamic views)
model {
webApp -> backend.api {
title 'requests data for the dashboard'
navigateTo dashboardRequestFlow
}
}
Code Formatter in VSCode Extension (thanks @pavelpykhtin, to #979)
New component ReactLikeC4
Low-level component with more control and event listeners.
const App = () => {
return (
<div>
<ReactLikeC4
viewId="index"
pannable={false}
zoomable
keepAspectRatio={false}
showElementLinks={false}
showDiagramTitle={false}
onNodeClick={...}
/>
</div>
)
}
Changelog
1.9.0 (2024-09-07)
LikeC4 Model API Access and traverse your architecture model programmatically using the LikeC4 Model API.
import { LikeC4 } from "likec4"
const likec4 = await LikeC4.fromWorkspace(`....`)
// Validation errors
console.log(likec4.getErrors())
// Traverse the model
const model = likec4.model()
model
.element('cloud.backend.api')
.incoming() // relationships incoming to the element
.filter(r => r.tags.includes('http')) // filter by tags
.map(r => r.source) // get source elements
// Layouted views
const diagrams = await likec4.diagrams()
Custom colors
specification {
color custom #6BD731
element customer {
notation "Person, Customer"
style {
shape person
color custom
}
}
}
Thanks to @pavelpykhtin, resolves #916
Changelog
1.8.0 (2024-08-27)
View notations
specification {
element customer {
notation "Person, Customer"
style {
shape person
color green
}
}
element staff {
notation "Person, Staff"
style {
shape person
}
}
}
<img width="436" alt="SCR-20240827-nhav" src="https://github.com/user-attachments/assets/bcc151e2-6c31-4b72-8651-a39ba79351d0">
technology
for relationships (Thanks to @pavelpykhtin, resolves #576)
title
for links (Thanks to @pavelpykhtin, resolves #871)
metadata
in DSL (Thanks to @pavelpykhtin)
[experimental] overview all views with use-overview
flag in cli
Changelog
1.7.3 (2024-08-16)
dsl: hiding relationship titles in views (closes #910)
react: where
filter on react components (closes #872, documentation)
// Display elements and relationships where:
// - tag is not 'legacy'
// - and
// - tag is 'v1' or 'v2'
<LikeC4View
viewId="index"
where={{
and: [
{ tag: { neq: 'legacy' } },
{
or: [
{ tag: { eq: 'v1' } },
{ tag: { eq: 'v2' } }
]
}
]
}}/>
react: export to png in new tab (198d79e)
cli: export png to flat directory (bcd23dd)
cli: warn layout drifts (49c1100)