How to Customize Description Symbol Palette in JavaScript Diagram?
The Symbol Palette in Syncfusion® JavaScript Diagram allows you to add and customize descriptions for the symbols displayed. This can enhance the usability of the palette by providing additional information about each symbol.
You can customize the descriptions of symbols in the palette by implementing the getSymbolInfo function. This sample demonstrates how to set up a symbol palette with descriptions:
// Initializes the symbol palette
palette = new ej.diagrams.SymbolPalette({
expandMode: 'Multiple',
palettes: [
{
id: 'connectors',
expanded: true,
symbols: connectorSymbols,
title: 'Connectors',
},
],
enableAnimation: true,
width: '100%',
height: '500px',
symbolHeight: 100,
symbolWidth: 100,
// Function to provide information about each symbol
getSymbolInfo: function (symbol) {
// Return an object with description settings for each symbol
return {
description: {
text: (symbol.addInfo).text, // Customize the display text
overflow:'Clip', // Define how text overflow is handled
wrap: "WrapWithOverflow", // Set text wrapping
fontSize: 12 // Define the font size of the description
},
};
},
});
palette.appendTo('#symbolpalette');
Conclusion
I hope you enjoyed learning how to customize the description of the symbol palette in the JavaScript Diagram.
You can refer to our JavaScript Diagram feature tour page to learn about its other groundbreaking feature representations and documentation, and how to quickly get started for configuration specifications.
You can also explore our JavaScript Diagram example to understand how to create and manipulate data. For current customers, you can check out our components from the License and Downloads page.
If you are new to Syncfusion®, you can try our 30-day free trial to check out our other controls. If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our support forums, Direct-Trac, or feedback portal. We are always happy to assist you!