-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
tfukaza
committed
Jul 21, 2024
1 parent
43453e4
commit b2acddc
Showing
10 changed files
with
765 additions
and
719 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
## Folders and Files | ||
|
||
- 📁 `components`: Code for SnapLine components, like nodes and lines. | ||
- 📄`base.ts`: Defines the base component class. | ||
- 📄`component.ts`: Defines the component class. | ||
- 📄`connector.ts`: Defines the connector class. | ||
- 📄`node.ts`: Defines the node class. | ||
- 📁 `theme`: CSS for standard SnapLine themes. | ||
- 📄`standard_dark.css`: Standard dark theme. | ||
- 📄`standard_light.css`: Standard light theme. | ||
- 📄 `camera.ts`: Code for the camera, which is used to move the view around. | ||
- 📄 `helper.ts`: Helper functions. | ||
- 📄 `index.ts`: The entry point for the SnapLine library. | ||
- 📄 `input.ts`: Code for handling user input. | ||
|
||
## Conventions | ||
|
||
### Class Member Function Naming | ||
|
||
There are three types of class member functions that exist in this library: | ||
|
||
- Private: Functions that are not meant to be accessed outside of the _class_ nor the _library_. These functions are prefixed with a pound sign (`#`), which enforces privacy in JavaScript. | ||
- Hidden: Functions that are only called within the _library_, but can be called between _classes_. These functions are prefixed with an underscore (`_`). Technically speaking, these functions are public, but they are not meant to be accessed outside of the _library_. | ||
- Public: Functions that are meant to be accessed outside of the _library_. These functions are not prefixed with anything. | ||
|
||
For private and hidden functions, the bundler will mangle (minify) the function names to reduce bundle size and discourage external code from directly calling these functions. | ||
|
||
### Class Member Variable Naming | ||
|
||
Similar to functions, there are three types of class member variables; private, hidden, and public. Their naming conventions are the same as functions. Also like functions, private and hidden variables will be mangled by the bundler. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.