krisztianb / typedoc-umlclass Goto Github PK
View Code? Open in Web Editor NEWPlugin for TypeDoc that generates UML class diagrams
License: ISC License
Plugin for TypeDoc that generates UML class diagrams
License: ISC License
Currently the plugin does not decorate template classes with their template parameters.
This should be possible. See:
https://plantuml.com/class-diagram#b09695ba6d76313d
https://forum.plantuml.net/6253/support-for-generics-templates
Dear @krisztianb
When rendering class diagram, some uml is too large like and not renderized completely :
Best Regards,
Youssef
Dear @krisztianb
Which mode is the best to renderize the class diagram ?
The render is fast.
It takes long time and CPU 100% for rendering the class diagram.
Best Regards,
Youssef
The peer dependency declaration:
"peerDependencies": {
"typedoc": "0.23.x || 0.24.x"
}
breaks compatibility with typedoc 0.25 due to dependency conflicts
The plugin has an option to specify the number of processes that should be used to generate the diagrams. This option can speed up the plugin dramatically but can easily be overlooked.
It would make sense to detect the number of CPUs available on the system and use that value as the default value for the option instead of defaulting to 1
.
Here is how this could be done: https://stackoverflow.com/questions/26049013/node-js-get-number-of-processors-available/37871843
Dear @krisztianb
Could you generate into a seperate file the uml code compatible plantuml ;-) and better if it is in a markdown file.
Best Regards,
Youssef
Add a new option embed
to the said option which creates a base64 encoded src
attribute value containing the image. See: https://stackoverflow.com/a/8499716/
Currently in the class diagram the class/interface members (properties and methods) are sorted alphabetically. It makes sense to add an option to sort them by visibility: first static, then public, then protected and then private members.
When I attempt to run typedoc I get an error for a value being invalid.
Full stack is:
Error: The plugin /Project/node_modules/typedoc-umlclass could not be loaded.
Error: umlClassDiagramBoxBorderWidth must be >= 0
at Object.convert (/usr/lib/node_modules/typedoc/dist/lib/utils/options/declaration.js:37:23)
at Options.setOptionValueToDefault (/usr/lib/node_modules/typedoc/dist/lib/utils/options/options.js:119:64)
at Options.addDeclaration (/usr/lib/node_modules/typedoc/dist/lib/utils/options/options.js:53:14)
at PluginOptions.addToApplication (/Project/node_modules/typedoc-umlclass/dist/plugin_options.js:287:25)
at Plugin.addOptionsToApplication (/Project/node_modules/typedoc-umlclass/dist/plugin.js:51:22)
at Plugin.initialize (/Project/node_modules/typedoc-umlclass/dist/plugin.js:43:14)
at load (/Project/node_modules/typedoc-umlclass/dist/index.js:9:27)
at PluginHost.load (/usr/lib/node_modules/typedoc/dist/lib/utils/plugins.js:28:21)
at CliApplication.bootstrap (/usr/lib/node_modules/typedoc/dist/lib/application.js:50:22)
at CliApplication.bootstrap (/usr/lib/node_modules/typedoc/dist/lib/cli.js:29:30)
/usr/lib/node_modules/typedoc/dist/lib/utils/options/declaration.js:37
throw new Error(getBoundsError(numberOption.name, numberOption.minValue, numberOption.maxValue));
^
Error: umlClassDiagramBoxBorderWidth must be >= 0
at Object.convert (/usr/lib/node_modules/typedoc/dist/lib/utils/options/declaration.js:37:23)
at Options.setOptionValueToDefault (/usr/lib/node_modules/typedoc/dist/lib/utils/options/options.js:119:64)
at Options.reset (/usr/lib/node_modules/typedoc/dist/lib/utils/options/options.js:24:18)
at CliApplication.bootstrap (/usr/lib/node_modules/typedoc/dist/lib/application.js:51:22)
at CliApplication.bootstrap (/usr/lib/node_modules/typedoc/dist/lib/cli.js:29:30)
at Object.<anonymous> (/usr/lib/node_modules/typedoc/bin/typedoc:5:5)
at Module._compile (internal/modules/cjs/loader.js:778:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
I am using typedoc with no other extensions.
I installed using the command "npm install typedoc-umlclass --save-dev"
I have tried adding a value to my typedoc.json for the umlClassDiagramBoxBorderWidth option with values of -1, 0, and 1; all failed.
Dear @krisztianb
I have an issue, the picture is not displayed on the page
When clicking on the link, I have this :
The html file :
alldestinationsassociationnamesrequestmessagecommand.zip
But the picture is complete
Best Regards,
Youssef
While generating the docs for the project of @yboujraf the typedoc process hangs indefinitely. It looks like that 3 child processes (JAVA PlantUML) don't finish properly. But why?
When I run typedoc with this plugin enabled, the console hangs at Documentation generated at ...
and doesn't continue. The only thing that happens is that it keeps generating log-files hs_err_pidxxxx.log
with a trace starting with There is insufficient memory for the Java Runtime Environment to continue.
Also log files called replay_pid1000.log
. I'm guessing this plugin consumes too much memory.
Console output:
> typedoc --umlClassDiagramType detailed --excludePrivate --tsconfig src/tsconfig.app.json --mode modules -module commonjs --exclude **/*.spec.ts --out documentation/typedoc src/app && documentation\serve-typedoc
Loaded plugin C:\Users\Werk\Desktop\beerhive\venuewebsite\node_modules\typedoc-umlclass
Using TypeScript 3.8.3 from C:\Users\Werk\Desktop\beerhive\venuewebsite\node_modules\typescript\lib
Rendering [========================================] 100%
Documentation generated at C:\Users\Werk\Desktop\beerhive\venuewebsite\documentation\typedoc
Dear @krisztianb
Happy to see I can generate class-diagram now ;-)
This is my status after installing the plugin.
Would you like to verify if my settings are the optimal to generate the uml class diagram ?
module.exports = {
inputFiles: ['./src/'],
mode: 'file',
includeDeclarations: true,
tsconfig: 'tsconfig.json',
out: './docs/dist/docs-class-diagram/',
excludePrivate: false,
excludeProtected: false,
excludeExternals: true,
readme: './README.md',
name: 'Demo Library project',
ignoreCompilerErrors: true,
plugin: 'typedoc-umlclass',
listInvalidSymbolLinks: true,
entryPoint: 'index',
categorizeByGroup: true,
media: './medias',
version: '',
gitRemote: 'remote',
gitRevision: 'revision',
theme: 'default',
umlClassDiagramType: 'detailed',
umlClassDiagramLocation: 'local',
umlClassDiagramFormat: 'png',
umlClassDiagramSectionTitle: 'Class-Diagram',
umlClassDiagramPosition: 'above',
umlClassDiagramHideEmptyMembers: 'false',
umlClassDiagramTopDownLayoutMaxSiblings: 6,
umlClassDiagramMemberVisibilityStyle: 'icon',
umlClassDiagramHideCircledChar: 'false',
umlClassDiagramHideShadow: 'false',
// umlClassDiagramBoxBackgroundColor: 'transparent',
// umlClassDiagramBoxBorderColor : 'transparent',
umlClassDiagramBoxBorderRadius: 2,
// umlClassDiagramBoxBorderWidth : 6,
// umlClassDiagramArrowColor: 3,
umlClassDiagramClassFontName: 'Courier',
umlClassDiagramClassFontStyle: 'bold',
umlClassDiagramClassAttributeFontStyle: 'italic'
};
Would you like to share the minimum required to optimize the rendering and get all the information.
Best Regards,
Youssef
Dear @krisztianb
May I ask you to include the legend into the class diagram like ?
That means for each icon to have his type or his definition
Best Regards,
Youssef
Dear @krisztianb
If I compare the uml generated and the type of the methods, ... are not the same and missing information :
If I compare with other tools, the same class, I have this :
Best Regards,
Youssef
Dear @krisztianb
Is it possible to rename in the \assts\images folder, the plantuml image renderized by the class name instead of umlClassDiagram-xxx.png ?
Best Regards,
Youssef
Dear @krisztianb
My config :
module.exports = {
inputFiles: ['./src/'],
mode: 'file',
//mode: 'modules',
includeDeclarations: true,
tsconfig: 'tsconfig.json',
out: './docs/dist/docs-class-diagram-files/',
excludePrivate: false,
excludeProtected: false,
excludeExternals: true,
readme: './README.md',
name: 'Axon ACP protocol Library project',
ignoreCompilerErrors: true,
plugin: 'typedoc-umlclass',
listInvalidSymbolLinks: true,
entryPoint: 'index',
categorizeByGroup: true,
media: './docs/dist/docs-class-diagram/assets',
version: '',
gitRemote: 'remote',
gitRevision: 'revision',
theme: 'default',
// Basic Settings
umlClassDiagramType: 'detailed',
umlClassDiagramLocation: 'embed',
//umlClassDiagramFormat: 'png',
umlClassDiagramFormat: 'svg',
// HTML output
umlClassDiagramSectionTitle: 'Class-Diagram',
umlClassDiagramPosition: 'above',
umlClassDiagramLegendType: 'full',
//umlClassDiagramLegendType: 'none',
//umlClassDiagramLegendType: 'only-included',
// Class diagram formating
umlClassDiagramMethodParameterOutput: 'complete',
//umlClassDiagramMemberOrder: 'private-to-public',
umlClassDiagramMemberOrder: 'public-to-private',
//umlClassDiagramMemberOrder: 'abc',
umlClassDiagramHideEmptyMembers: 'false',
// umlClassDiagramTopDownLayoutMaxSiblings: 6,
umlClassDiagramMemberVisibilityStyle: 'icon',
umlClassDiagramHideCircledChar: 'false',
umlClassDiagramHideShadow: 'false',
//umlClassDiagramBoxBackgroundColor: transparent | #RGBHEX ,
//umlClassDiagramBoxBorderColor: transparent | #RGBHEX ,
umlClassDiagramBoxBorderRadius: 2,
//umlClassDiagramBoxBorderWidth: 1,
//umlClassDiagramArrowColor: #RGBHEX ,
umlClassDiagramClassFontName: 'Courier',
//umlClassDiagramClassFontSize: integer ,
umlClassDiagramClassFontStyle: 'bold',
//umlClassDiagramClassFontColor: transparent|#RGBHEX ,
//umlClassDiagramClassAttributeFontName: font-name ,
umlClassDiagramClassAttributeFontStyle: 'italic',
//umlClassDiagramClassAttributeFontColor: transparent|#RGBHEX,
// Other settings
umlClassDiagramGeneratorProcessCount: 1,
umlClassDiagramHideProgressBar: true,
umlClassDiagramCreatePlantUmlFiles: true,
umlClassDiagramVerboseOutput: false
};
The markdown is not rendered on 'Global' page and on each 'interface' the markdown comment + table are not rendered.
On 'type' and 'enum', I have the markdown content and table rendered.
Best regards,
Youssef
Dear @krisztianb
I am using typedoc-plugin-pages and yours plugin.
It will be nice if i can combine both plugins.
Best regards,
Youssef
The latest PlantUML version includes a small web server called PicoWeb that can be used to generate class diagrams on the fly. It works just like the one on the PlantUML website.
More info here: https://plantuml.com/picoweb
We could extend the umlClassDiagramLocation
option with another value to support this.
Dear @krisztianb
I see now from the previous picture sent, a better decode of the type but I don't have all the dependencies that means interface, inheritance are missing.
Best Regards,
Youssef
Originally posted by @yboujraf in #6 (comment)
Hi,
First of all thank you for the initiative for this package.
I installed the package and tried to generate the documentation but I got a Maximum call stack size exceeded
error in return.
Have you ever had this problem before?
Thank you in advance
My package.json file.
{
...
"devDependencies": {
...
"typedoc": "0.18.0",
"typedoc-plugin-mermaid": "1.3.0",
"typedoc-plugin-pages": "1.0.1",
"typedoc-umlclass": "0.2.2",
"typescript": "3.9.7",
...
}
}
My command line.
rimraf dist-doc && typedoc --out dist-doc --mode file --tsconfig src/tsconfig.json --theme pages-plugin types src
The error
Loaded plugin /.../node_modules/typedoc-plugin-mermaid
Loaded plugin /.../node_modules/typedoc-plugin-pages
Loaded plugin /.../node_modules/typedoc-umlclass
Using TypeScript 3.9.7 from /.../node_modules/typescript/lib
Rendering [==============--------------------------] 34%/.../node_modules/typedoc-umlclass/dist/typedoc/typedoc_utils.js:163
let subTypes = new Array();
^
RangeError: Maximum call stack size exceeded
at Function.getSubTypesForReflection (/.../node_modules/typedoc-umlclass/dist/typedoc/typedoc_utils.js:163:24)
at Function.getSubTypesForReflection (/.../node_modules/typedoc-umlclass/dist/typedoc/typedoc_utils.js:181:65)
at Function.getSubTypesForReflection (/.../node_modules/typedoc-umlclass/dist/typedoc/typedoc_utils.js:181:65)
at Function.getSubTypesForReflection (/.../node_modules/typedoc-umlclass/dist/typedoc/typedoc_utils.js:181:65)
at Function.getSubTypesForReflection (/.../node_modules/typedoc-umlclass/dist/typedoc/typedoc_utils.js:181:65)
at Function.getSubTypesForReflection (/.../node_modules/typedoc-umlclass/dist/typedoc/typedoc_utils.js:181:65)
at Function.getSubTypesForReflection (/.../node_modules/typedoc-umlclass/dist/typedoc/typedoc_utils.js:181:65)
at Function.getSubTypesForReflection (/.../node_modules/typedoc-umlclass/dist/typedoc/typedoc_utils.js:181:65)
at Function.getSubTypesForReflection (/.../node_modules/typedoc-umlclass/dist/typedoc/typedoc_utils.js:181:65)
at Function.getSubTypesForReflection (/.../node_modules/typedoc-umlclass/dist/typedoc/typedoc_utils.js:181:65)
Hi,
I started to use this extension. However, I noticed that the generated graphs are quite hard to read due to the lack of formatting.
Could it be possible to add some formatting, e.g. putting functions and argument names in bold, putting the return value in italic/red, or whatever, to improve the graphs readability ?
It seems possible as I saw that plantUML allows some formatting :
https://plantuml.com/en/creole
Cordially,
The plugin has a lot of options that are all prefixed with umlClassDiagram
. It would make sense to move these into an object and so get rid of having to prefix each option with the same string.
The plugin does not seem to support typedoc 0.24.x and gives the error:
" Tried to set an option (umlClassDiagram) that was not declared"
0.23.x works perfectly fine
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.