### Adding magic-api Spring Boot Starter Dependency (Maven)
Source: https://github.com/ssssssss-team/magic-api/blob/master/README.md
This Maven dependency integrates the `magic-api-spring-boot-starter` into a Spring Boot project. It simplifies the setup by providing auto-configuration for the magic-api framework. Users should ensure they use the latest stable version.
```XML
org.ssssssss
magic-api-spring-boot-starter
2.2.1
```
--------------------------------
### Configuring magic-api Properties in Spring Boot
Source: https://github.com/ssssssss-team/magic-api/blob/master/README.md
This snippet configures `magic-api` within a Spring Boot `application.properties` file. It sets the server port, defines the web UI entry point, and specifies the file storage location for `magic-api` resources. If the resource location starts with `classpath:`, the configuration will be in read-only mode.
```Properties
server.port=9999
#配置web页面入口
magic-api.web=/magic/web
#配置文件存储位置。当以classpath开头时,为只读模式
magic-api.resource.location=/data/magic-api
```
--------------------------------
### Executing nGQL Queries with Magic API Nebula Plugin
Source: https://github.com/ssssssss-team/magic-api/blob/master/magic-api-plugins/magic-api-plugin-nebula/nebula插件.md
This JavaScript snippet demonstrates how to use the `nebula` module within a Magic API script to execute nGQL queries. It shows executing a query and converting the result, as well as executing a query to get a NebulaModel.
```javascript
import nebula;
var ngsl =
""""
USE db_name;MATCH p_=(p:`assignee`)-[*3]-(p2:`transferor`) where id(p2) == \"阿里巴巴\" or id(p)== \"阿里巴巴\" RETURN p_ limit 1000'
""""
var resultJson = nebula.executeJson(ngsl)
nebula.convert(resultJson)
nebula.executeNebulaModel(ngsl)
其他支持的方法不太常用, 这里不再一一列举, 可参考源码
org.ssssssss.magicapi.nebula.NebulaModule
```
--------------------------------
### Example JSON Response Format for Nebula Query Results
Source: https://github.com/ssssssss-team/magic-api/blob/master/magic-api-plugins/magic-api-plugin-nebula/nebula插件.md
This JSON snippet shows the expected data structure returned by the Magic API Nebula plugin when executing queries. It includes `nodes` and `edges` arrays suitable for graph visualization libraries.
```json
{
"code": 0,
"message": "success",
"data": {
"nodes": [
{
"edgeSize": 1,
"assignee.name": "中航纽赫融资租赁(上海)有限公司",
"type": "vertex",
"assignee.addr": "上海市中国(上海)自由贸易试验区正定路530号A5库区集中辅助区三层318室",
"assignee.legal_person": "周勇",
"registrant.addr": "上海市浦东新区南泉路1261号",
"registrant.name": "中航国际租赁有限公司",
"id": "中航纽赫融资租赁(上海)有限公司",
"assignee.type": "企业"
},
{
"edgeSize": 15,
"type": "vertex",
"transferor.name": "陕西海富融资租赁有限公司",
"transferor.legal_person": "刘子瑜",
"transferor.type": "企业",
"transferor.addr": "陕西省西安市西安经济技术开发区未央路170号赛高城市广场2号楼企业总部大厦26层05单元",
"registrant.addr": "广东省深圳市前海深港合作区南山街道梦海大厦5035号前海华润金融中心T5写字楼1808",
"registrant.name": "深圳前海盈峰商业保理有限公司",
"id": "陕西海富融资租赁有限公司"
}, ...
],
"edges": [
{
"dst": "陕西海富融资租赁有限公司",
"src": "中航纽赫融资租赁(上海)有限公司",
"source": "中航纽赫融资租赁(上海)有限公司",
"label": "trans_with",
"type": "edge",
"target": "陕西海富融资租赁有限公司",
"name": "trans_with",
"ranking": 0,
"value": 0
},...
]
},
"timestamp": 1692149280167,
"requestTime": 1692149280143,
"executeTime": 24
}
```
--------------------------------
### Displaying Magic-API Loading Text in JavaScript
Source: https://github.com/ssssssss-team/magic-api/blob/master/magic-editor/src/main/resources/magic-editor/index.html
This JavaScript function initializes default configuration for the magic-api application, merges it with any existing window configuration, and then updates the loading text and document title based on the combined configuration. It dynamically sets the 'By [title] [version]' text and the browser tab title.
```javascript
function showMaLoadingText(){ let defaultConfig = { title: 'magic-api', version: '2.2.1' }
defaultConfig = { ...defaultConfig, ...window.MAGIC_EDITOR_CONFIG }
let $dom = document.getElementById('magic-loading-text')
$dom.innerText = 'By ' + defaultConfig.title + ' ' + defaultConfig.version
document.title = defaultConfig.title + ' v' + defaultConfig.version }
```
--------------------------------
### Styling Magic-API Loading Wrapper and Container in CSS
Source: https://github.com/ssssssss-team/magic-api/blob/master/magic-editor/src/main/resources/magic-editor/index.html
This CSS defines the visual appearance and animation for a loading screen within the magic-api application. It positions a full-screen overlay, centers a loading container, and styles a dynamic 'Loading' text with a stretching animation for individual letters and a blinking effect for the loading text.
```css
.magic-loading-wrapper {position: absolute;top: 0;bottom: 0;left: 0;right: 0;z-index: 10000000;text-align: center;background: #fff;} .magic-loading-container {position: absolute;top: 50%;left: 50%;width: 500px;height: 100px;margin-left: -250px;margin-top: -50px;text-align: center;} .magic-loading-container .magic-title {font-size: 0;color: #0075ff;letter-spacing: 0;} .magic-loading-container .magic-title label {font-size: 14px;display: inline-block;margin-top: 5px;vertical-align: top;} .magic-loading-container .magic-title span {font-size: 20px;display: inline-block;padding: 0 3px;animation: stretch 1s infinite;} .magic-loading-container .magic-title span:nth-child(1) {animation-delay: calc(1s / 8 * 0 / 2);} .magic-loading-container .magic-title span:nth-child(2) {animation-delay: calc(1s / 8 * 1 / 2);} .magic-loading-container .magic-title span:nth-child(3) {animation-delay: calc(1s / 8 * 2 / 2);} .magic-loading-container .magic-title span:nth-child(4) {animation-delay: calc(1s / 8 * 3 / 2);} .magic-loading-container .magic-title span:nth-child(5) {animation-delay: calc(1s / 8 * 4 / 2);} .magic-loading-container .magic-title span:nth-child(6) {animation-delay: calc(1s / 8 * 5 / 2);} .magic-loading-container .magic-title span:nth-child(7) {animation-delay: calc(1s / 8 * 6 / 2);} .magic-loading-container .magic-title span:nth-child(8) {animation-delay: calc(1s / 8 * 7 / 2);} .magic-loading-container .magic-loading-text {text-align: center;font-weight: bolder;font-style: italic;color: #889aa4;font-size: 14px;margin-top: 5px;animation: blink-loading 2s ease-in infinite;} @keyframes stretch {0% {transform: scale(1);}25% {transform: scale(1.2);}50% {transform: scale(1);}100% {transform: scale(1);}} @keyframes blink-loading {0% {opacity: 1;}50% {opacity: 0.5;}100% {opacity: 1;}}
```
--------------------------------
### Configuring Nebula Graph Connection in YAML
Source: https://github.com/ssssssss-team/magic-api/blob/master/magic-api-plugins/magic-api-plugin-nebula/nebula插件.md
This YAML configuration snippet defines the connection parameters for the Nebula Graph database, including host address, username, and password. Default values are provided using environment variables.
```yaml
nebula:
hostAddress: ${NEBULA_HOSTADDRESS:localhost:9669}
userName: ${NEBULA_USERNAME:root}
password: ${NEBULA_PASSWORD:nebula}
```
--------------------------------
### Adding Maven Dependency for Magic API Nebula Plugin
Source: https://github.com/ssssssss-team/magic-api/blob/master/magic-api-plugins/magic-api-plugin-nebula/nebula插件.md
This XML snippet shows the required Maven dependency to include the Magic API Nebula plugin in your project. Replace `magic-api-lastest-version` with the actual version.
```xml
org.ssssssss
magic-api-plugin-nebula
magic-api-lastest-version
```
--------------------------------
### Hiding Magic-API Loading Screen in JavaScript
Source: https://github.com/ssssssss-team/magic-api/blob/master/magic-editor/src/main/resources/magic-editor/index.html
This JavaScript function hides the magic-api loading screen by setting the display style of the 'magic-loading-wrapper' element to 'none'. This is typically called once the application content has loaded and the loading indicator is no longer needed.
```javascript
function hideMaLoading() {
document.getElementById('magic-loading-wrapper').style.display = 'none'
}
```
=== COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.