General Widget Questions
Can a computed result include both text and numbers?
Can a computed result include both text and numbers?
The computed portion of the calculator doesn’t support mixed data types in a single result. However, you can work around this limitation using a two-widget approach:
- Primary Equation Widget: Performs the numerical calculation
- Secondary Text Widget: Combines the computation output with text using the
print()function
visibleIf property with conditional statements.Example Implementation:How do I reference data from lookup widgets?
How do I reference data from lookup widgets?
The method depends on the type of lookup widget:Data Table Lookups:Shared Table Lookups:Toggle Lookups:
What's the difference between 'hidden' and 'visibleIf' properties?
What's the difference between 'hidden' and 'visibleIf' properties?
How do I create multi-step calculations?
How do I create multi-step calculations?
Break complex calculations into multiple equation widgets:
- Intermediate calculations can be hidden from users
- Final results can reference intermediate steps
- Display widgets can format and present results
How do I handle units in calculations?
How do I handle units in calculations?
ClearCalcs has built-in unit handling:
- Input widgets automatically handle unit conversion
- Equation widgets inherit units from inputs
- Unit-aware functions maintain dimensional consistency
- Define units in input widget
unitproperty - Use consistent base units throughout calculations
- Let the system handle conversions automatically
- Check the “What’s NOT unit-aware” documentation for exceptions
Can I create custom validation rules?
Can I create custom validation rules?
Yes, using the
check functionality in equation widgets:Widget-Specific Questions
When should I use a Data Table vs Shared Table lookup?
When should I use a Data Table vs Shared Table lookup?
How do I create dependent dropdowns?
How do I create dependent dropdowns?
Use the
visibleIf property and data filtering:How do I handle dynamic widget arrays?
How do I handle dynamic widget arrays?
For dynamic numbers of similar widgets, consider:
- Subsheet Widgets for complex linked calculations
- Table Widgets for simple data entry arrays
- Loop-based equation widgets for calculations over arrays
Troubleshooting
My widget references aren't working
My widget references aren't working
Common issues and solutions:Check Reference IDs:
- Ensure
referenceIdis unique across the template - Verify spelling in widget references (case-sensitive)
- Use valid JavaScript identifier format (no spaces, special chars)
- If
visibleIfis false, widget cannot be referenced - Ensure referenced widgets exist and are visible
- Ensure data types match expected input types
- Verify lookup indices are within valid range
Circular reference errors
Circular reference errors
Causes:
- Widget A references Widget B, and Widget B references Widget A
- Subsheet commonInputs that depend on derived data
- Identify the dependency chain
- Break circular dependencies with intermediate widgets
- Use hidden widgets for one-way data flow
- Review subsheet commonInput configurations
Performance issues with large datasets
Performance issues with large datasets
Optimization strategies:
- Use Shared Tables instead of large Data Tables
- Implement data filtering to reduce displayed options
- Consider breaking large calculations into smaller steps
- Use
hidden: truefor intermediate calculations - Minimize complex
visibleIfconditions on frequently updated widgets
Getting Help
If you encounter issues not covered in this FAQ:- Check the specific widget documentation for detailed configuration options
- Review existing templates with similar functionality
- Test in isolation by creating a minimal example
- Contact the development team with specific error messages and widget configurations
This FAQ is regularly updated based on common questions from template developers. If you have suggestions for additional topics, please reach out to the development team.