Skip to main content
Glama
ascii.ts2.06 kB
export const ASCII_CHARS = { horizontal: '─', vertical: '│', topLeft: '┌', topRight: '┐', bottomLeft: '└', bottomRight: '┘', cross: '┼', teeUp: '┴', teeDown: '┬', teeLeft: '┤', teeRight: '├', // Line chart characters lineHorizontal: '─', lineVertical: '│', lineUpRight: '└', lineUpLeft: '┘', lineDownRight: '┌', lineDownLeft: '┐', lineCross: '┼', // Box drawing for smooth curves curveUpRight: '╰', curveUpLeft: '╯', curveDownRight: '╭', curveDownLeft: '╮', // Bar chart characters fullBlock: '█', leftHalfBlock: '▌', rightHalfBlock: '▐', lightShade: '░', mediumShade: '▒', darkShade: '▓', // Scatter plot point: '●', smallPoint: '·', // Sparkline sparkBlocks: ['▁', '▂', '▃', '▄', '▅', '▆', '▇', '█'] } as const; export function padLeft(text: string, width: number, char: string = ' '): string { return text.padStart(width, char); } export function padRight(text: string, width: number, char: string = ' '): string { return text.padEnd(width, char); } export function center(text: string, width: number, char: string = ' '): string { const totalPadding = width - text.length; const leftPadding = Math.floor(totalPadding / 2); const rightPadding = totalPadding - leftPadding; return char.repeat(leftPadding) + text + char.repeat(rightPadding); } export function clamp(value: number, min: number, max: number): number { return Math.max(min, Math.min(max, value)); } export function normalize(value: number, min: number, max: number): number { if (max === min) return 0; return (value - min) / (max - min); } export function formatNumber(value: number, precision: number = 2): string { return value.toFixed(precision); } export function createGrid(width: number, height: number): string[][] { return Array(height).fill(null).map(() => Array(width).fill(' ')); } export function gridToString(grid: string[][]): string { return grid.map(row => row.join('')).join('\n'); }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/gianlucamazza/mcp-ascii-charts'

If you have feedback or need assistance with the MCP directory API, please join our Discord server