Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/ResearAI/AutoFigure
/ functions
Functions
374 in github.com/ResearAI/AutoFigure
⨍
Functions
374
◇
Types & classes
56
↳
Endpoints
12
↓ 86 callers
Function
_log
Log with flush to ensure output in background threads.
backend/autofigure_routes.py:1029
↓ 37 callers
Function
cn
(...inputs: ClassValue[])
frontend/lib/utils.ts:5
↓ 27 callers
Function
get_session_lock
Get or create a lock for the session.
backend/autofigure_routes.py:192
↓ 10 callers
Function
code_to_png
Converts code (SVG or mxGraph XML) to PNG based on output format. Args: code: The code to convert (SVG or mxGraph XML). outp
autofigure/generator.py:1332
↓ 10 callers
Function
useAutoFigure
()
frontend/contexts/autofigure-context.tsx:465
↓ 7 callers
Function
extractPdfText
(file: File)
frontend/lib/pdf-utils.ts:47
↓ 7 callers
Function
isPdfFile
(file: File)
frontend/lib/pdf-utils.ts:59
↓ 6 callers
Function
call_google_genai_multimodal
Legacy function name kept for compatibility. Routes to call_unified_llm using CONFIG settings.
autofigure/generator.py:237
↓ 6 callers
Function
getAuthToken
()
frontend/contexts/autofigure-context.tsx:78
↓ 6 callers
Function
getBackendUrl
()
frontend/contexts/autofigure-context.tsx:72
↓ 5 callers
Function
isTextFile
(file: File)
frontend/lib/pdf-utils.ts:66
↓ 5 callers
Function
parseIntSafe
* Safely parse integer from environment variable with validation
frontend/lib/ai-providers.ts:62
↓ 5 callers
Function
require_autofigure
Check if autofigure module is available.
backend/autofigure_routes.py:199
↓ 4 callers
Method
_get_default_base_url
Get default base URL for a provider.
autofigure/config.py:96
↓ 4 callers
Function
_get_mxgraphxml_placeholder_spec
Returns placeholder specification adapted for mxGraph XML format.
autofigure/generator.py:424
↓ 4 callers
Function
evaluate_code
Evaluation Agent: Evaluate code (SVG or mxGraph XML) quality, return score and critique Supports all topic types: paper, survey, blog, textbo
autofigure/generator.py:1437
↓ 4 callers
Function
extractDiagramXML
(xml_svg_string: string)
frontend/lib/utils.ts:673
↓ 4 callers
Function
formatXML
(xml: string, indent: string = " ")
frontend/lib/utils.ts:15
↓ 4 callers
Function
isLangfuseEnabled
()
frontend/lib/langfuse.ts:25
↓ 4 callers
Function
useDiagram
()
frontend/contexts/diagram-context.tsx:274
↓ 3 callers
Method
_build_enhancement_prompt
Build the enhancement prompt based on input type.
autofigure/enhancer.py:335
↓ 3 callers
Function
call_google_genai_multimodal
Calls the Google GenAI multimodal API with intelligent retry logic. Args: contents: List of content including text and images.
autofigure/judge.py:68
↓ 3 callers
Function
checkAllQuotaLimits
()
frontend/components/chat-panel.tsx:791
↓ 3 callers
Function
convertPdfToMarkdown
(formData: FormData)
frontend/app/actions/pdf-actions.ts:18
↓ 3 callers
Function
getMessageTextContent
(message: UIMessage)
frontend/components/chat-message-display.tsx:154
↓ 3 callers
Function
getUserOriginalText
(message: UIMessage)
frontend/components/chat-message-display.tsx:163
↓ 3 callers
Function
sendChatMessage
( parts: any, xml: string, previousXml: string, sessionId: string, )
frontend/components/chat-panel.tsx:814
↓ 3 callers
Function
showValidationErrors
(errors: string[])
frontend/components/chat-input.tsx:90
↓ 3 callers
Function
validateFiles
( newFiles: File[], existingCount: number, )
frontend/components/chat-input.tsx:52
↓ 3 callers
Function
validate_mxgraphxml_syntax
Validates mxGraph XML syntax for draw.io compatibility. Args: mxgraph_code: The mxGraph XML code to validate. Returns:
autofigure/generator.py:954
↓ 3 callers
Function
wrapWithMxFile
(xml: string)
frontend/lib/utils.ts:115
↓ 2 callers
Method
_extract_image_from_openai_response
Extract image from OpenAI-compatible API response (BianXie/OpenRouter format).
autofigure/enhancer.py:852
↓ 2 callers
Method
_get_content_type_context
Get evaluation context and criteria based on content type.
autofigure/judge.py:162
↓ 2 callers
Method
_get_default_model
Get default model for a provider.
autofigure/config.py:105
↓ 2 callers
Method
_list_images
List all image files in a folder.
autofigure/judge.py:519
↓ 2 callers
Function
_save_base64_image_from_markdown
Extract and save base64 image from markdown format. Format: 
autofigure/enhancer.py:228
↓ 2 callers
Method
call
Call the LLM with text and optional images. Args: contents: List of content items (strings or PIL Images) te
autofigure/utils/llm_client.py:55
↓ 2 callers
Function
call_unified_llm
Unified LLM call interface - supports multiple providers (bianxie, openrouter, gemini) IMPORTANT: This function MUST respect the provider pa
autofigure/generator.py:93
↓ 2 callers
Function
charCountDict
* Create a character count dictionary from a string * Used for attribute-order agnostic comparison
frontend/lib/utils.ts:241
↓ 2 callers
Function
cleanupSnapshotsAfter
(messageIndex: number)
frontend/components/chat-panel.tsx:781
↓ 2 callers
Function
copyMessageToClipboard
(messageId: string, text: string)
frontend/components/chat-message-display.tsx:213
↓ 2 callers
Function
countTextTokens
(text: string)
frontend/lib/token-counter.ts:18
↓ 2 callers
Function
create_fallback_evaluation
(default_score: float = 5.0)
autofigure/generator.py:1353
↓ 2 callers
Method
enhance
Enhance an image file using the configured provider. Args: input_path: Path to the input image (PNG) output_
autofigure/enhancer.py:267
↓ 2 callers
Method
evaluate_figures_parallel
Evaluate multiple figures in parallel. Args: figure_paths: Dictionary of figure paths, format: {figure_id: file_path}.
autofigure/judge.py:411
↓ 2 callers
Function
figure_generator_pipeline
Main pipeline for generating scientific figures (SVG or mxGraph XML format). Args: paper_path: Path to the content file. ref
autofigure/generator.py:1809
↓ 2 callers
Function
findCachedResponse
( promptText: string, hasImage: boolean, )
frontend/lib/cached-responses.ts:911
↓ 2 callers
Function
formatNumber
(n: number)
frontend/components/quota-limit-toast.tsx:22
↓ 2 callers
Method
generate
Generate a scientific figure from a text description. Args: description: Text description of the figure to generate
autofigure/agent.py:103
↓ 2 callers
Function
generate_initial_code
Generates initial diagram code (SVG or mxGraph XML) based on the output format. Args: paper_content: The content to visualize.
autofigure/generator.py:638
↓ 2 callers
Function
getLangfuseClient
()
frontend/lib/langfuse.ts:8
↓ 2 callers
Function
getPreviousXml
(beforeIndex: number)
frontend/components/chat-panel.tsx:765
↓ 2 callers
Function
getStoredAccessCodeRequired
()
frontend/components/settings-dialog.tsx:42
↓ 2 callers
Function
getTelemetryConfig
(params: { sessionId?: string userId?: string })
frontend/lib/langfuse.ts:79
↓ 2 callers
Function
get_file_extension
Get file extension (lowercase, without dot). Args: path: File path Returns: File extension (e.g., 'pdf', 'md')
autofigure/utils/file_utils.py:110
↓ 2 callers
Function
get_initial_prompt_template
(topic: str, content: str, output_format: str = None)
autofigure/generator.py:266
↓ 2 callers
Function
get_reference_figures_for_topic
Load reference figures for the specified topic. Currently only 'paper' topic has reference figures. Returns: List of PIL.Image o
backend/autofigure_routes.py:131
↓ 2 callers
Function
handleModeChange
(mode: EnhancementMode)
frontend/components/autofigure/BeautificationDialog.tsx:36
↓ 2 callers
Function
improve_code
Improvement Agent: Generate improved code (SVG or mxGraph XML) based on previous critique Use initial generation prompt + previous evaluation
autofigure/generator.py:1562
↓ 2 callers
Function
isValidFileType
(file: File)
frontend/components/chat-input.tsx:28
↓ 2 callers
Function
load_reference_figures
(figure_paths: List[str])
autofigure/generator.py:254
↓ 2 callers
Function
normalizeWs
(s: string)
frontend/lib/utils.ts:483
↓ 2 callers
Function
onFetchChart
(saveToHistory = true)
frontend/components/chat-panel.tsx:110
↓ 2 callers
Function
parseStorageCount
(key: string)
frontend/lib/use-quota-manager.tsx:51
↓ 2 callers
Function
preprocess_svg_for_cairo
(svg_code: str)
autofigure/generator.py:1073
↓ 2 callers
Function
processFilesAndAppendContent
( baseText: string, files: File[], pdfData: Map<File, FileData>, imageParts?:
frontend/components/chat-panel.tsx:848
↓ 2 callers
Function
repair_code
Attempts to repair broken code based on output format. Args: code: The broken code (SVG or mxGraph XML). error_message: The
autofigure/generator.py:906
↓ 2 callers
Function
repair_mxgraphxml
Attempts to repair broken mxGraph XML code. Args: mxgraph_code: The broken mxGraph XML code. error_message: The parsing erro
autofigure/generator.py:831
↓ 2 callers
Function
repair_svg
Attempts to repair broken SVG code. Args: svg_code: The broken SVG code. error_message: The parsing error message.
autofigure/generator.py:759
↓ 2 callers
Function
restoreDiagramFromSnapshot
(savedXml: string)
frontend/components/chat-panel.tsx:775
↓ 2 callers
Function
save_iteration_results
Save iteration results to files. Args: iteration: The iteration number. code: The SVG or mxGraph XML code to save. q
autofigure/generator.py:1737
↓ 2 callers
Function
showErrorToast
(message: React.ReactNode)
frontend/components/chat-input.tsx:38
↓ 2 callers
Function
submitFeedback
(messageId: string, value: "good" | "bad")
frontend/components/chat-message-display.tsx:249
↓ 2 callers
Function
update_config_from_sdk
Update CONFIG from SDK Config object. Args: sdk_config: autofigure.config.Config object
autofigure/generator.py:57
↓ 2 callers
Function
validateMxCellStructure
(xml: string)
frontend/lib/utils.ts:541
↓ 2 callers
Function
validate_code_syntax
Validates code syntax based on the output format. Args: code: The code to validate (SVG or mxGraph XML). output_format: 'svg
autofigure/generator.py:1055
↓ 1 callers
Function
_call_openai_compatible
Call OpenAI-compatible API (works with bianxie, openrouter, etc.) IMPORTANT: This function requires api_key, model, and base_url to be passe
autofigure/generator.py:154
↓ 1 callers
Method
_enhance_with_bianxie
Enhance image using BianXie API. BianXie API format (OpenAI-compatible chat completions): - Endpoint: https://api.bianxie.ai
autofigure/enhancer.py:544
↓ 1 callers
Method
_enhance_with_gemini
Enhance image using Google Gemini native API. Gemini API uses a different format than OpenAI-compatible APIs: - URL: {base_u
autofigure/enhancer.py:710
↓ 1 callers
Method
_enhance_with_openrouter
Enhance image using OpenRouter API. OpenRouter API format: - Endpoint: https://openrouter.ai/api/v1/chat/completions
autofigure/enhancer.py:626
↓ 1 callers
Function
_export_via_playwright
Export mxGraph XML to PNG using Playwright with draw.io embed mode. This mirrors the approach used by next-ai-draw-io (react-drawio componen
autofigure/generator.py:1167
↓ 1 callers
Method
_generate_comparison_summary
Generate summary for pairwise comparison.
autofigure/judge.py:1330
↓ 1 callers
Function
_generate_image_bianxie
Generate image using BianXie API. BianXie returns images as markdown in content: 
backend/autofigure_routes.py:1380
↓ 1 callers
Function
_generate_image_gemini
Generate image using Google Gemini API directly. Gemini API uses a different format than OpenAI-compatible APIs: - URL: {base_url}/model
backend/autofigure_routes.py:1620
↓ 1 callers
Function
_generate_image_openrouter
Generate image using OpenRouter API. Based on OpenRouter API documentation (https://openrouter.ai/google/gemini-3.1-flash-image-preview/api)
backend/autofigure_routes.py:1464
↓ 1 callers
Method
_generate_individual_summary
Generate summary for single figure evaluation.
autofigure/judge.py:1271
↓ 1 callers
Function
_get_blog_mxgraphxml_prompt_template
Returns the mxGraph XML prompt template for blog posts.
autofigure/generator.py:541
↓ 1 callers
Function
_get_blog_prompt_template
Returns the complex prompt template for blog posts.
autofigure/generator.py:365
↓ 1 callers
Method
_get_default_enhancement_model
Get default enhancement model for a provider.
autofigure/config.py:114
↓ 1 callers
Function
_get_paper_mxgraphxml_prompt_template
Returns the mxGraph XML prompt template for research papers.
autofigure/generator.py:437
↓ 1 callers
Function
_get_paper_prompt_template
Returns the complex prompt template for research papers.
autofigure/generator.py:311
↓ 1 callers
Function
_get_survey_mxgraphxml_prompt_template
Returns the mxGraph XML prompt template for survey papers.
autofigure/generator.py:492
↓ 1 callers
Function
_get_survey_prompt_template
Returns the complex prompt template for survey papers.
autofigure/generator.py:337
↓ 1 callers
Function
_get_textbook_mxgraphxml_prompt_template
Returns the mxGraph XML prompt template for textbook content.
autofigure/generator.py:589
↓ 1 callers
Function
_get_textbook_prompt_template
Returns the complex prompt template for textbook content.
autofigure/generator.py:392
↓ 1 callers
Method
_read_file_content
Read content from a file based on its type. Args: path: File path Returns: File content as text, or
autofigure/extractor.py:124
↓ 1 callers
Method
_read_pdf
Read PDF file content using available libraries. Tries multiple methods in order of preference.
autofigure/extractor.py:153
↓ 1 callers
Method
_read_text
Read plain text or markdown file.
autofigure/extractor.py:144
↓ 1 callers
Method
_recalculate_overall_score
Recalculate overall_score as the average of all dimension scores.
autofigure/judge.py:716
↓ 1 callers
Method
_validate_comparison_format
Validate comparison result format.
autofigure/judge.py:1052
next →
1–100 of 374, ranked by callers