upload
This commit is contained in:
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,502 @@
|
|||||||
|
import os
|
||||||
|
import re
|
||||||
|
import sys
|
||||||
|
import json
|
||||||
|
import time
|
||||||
|
import datetime
|
||||||
|
|
||||||
|
import uvicorn
|
||||||
|
from fastapi import FastAPI, HTTPException
|
||||||
|
from fastapi.responses import FileResponse
|
||||||
|
from fastapi.staticfiles import StaticFiles
|
||||||
|
|
||||||
|
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
||||||
|
import newsetting as ten
|
||||||
|
|
||||||
|
|
||||||
|
tent = ten.All_Setting(host='192.168.5.5', port=3306, db='project_waima') # 任务库, 只读
|
||||||
|
COUPON_VIEW = 'waima_coupon_summary' # 券汇总视图, 汇总表.sql 里建
|
||||||
|
KEYWORD_VIEW = 'waima_keyword_summary' # 关键词汇总视图, 汇总表.sql 里建
|
||||||
|
PAGE_TABLE = 'waima_page_summary' # 页级汇总表, 采集脚本/补数脚本往里写
|
||||||
|
INPUT_TABLE = 'waima_keyword_input' # 只有它带城市, 用来做城市筛选
|
||||||
|
COUPON_RAW = 'waima_coupon_detail' # 抽屉里看商品明细时才回读
|
||||||
|
SEARCH_RAW = 'waima_keyword_search'
|
||||||
|
|
||||||
|
PORT = 18765 # 看板端口(8765 被百度输入法占了)
|
||||||
|
LIVE_SECONDS = 300 # 最近 5 分钟有新页入库就算"采集中"
|
||||||
|
CACHE_SECONDS = 20 # 汇总数据缓存秒数, 看板 30 秒刷一次
|
||||||
|
WEB_DIR = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'web', 'dist') # 前端构建产物
|
||||||
|
|
||||||
|
TIME_FMT = '%Y-%m-%d %H:%M:%S'
|
||||||
|
BATCH_RE = re.compile(r'^[\w\-]{1,64}$') # 批次/店铺id 只允许字母数字下划线横杠
|
||||||
|
|
||||||
|
app = FastAPI()
|
||||||
|
|
||||||
|
table_cache = {'time': 0, 'data': None} # 汇总数据缓存
|
||||||
|
|
||||||
|
|
||||||
|
def check_text(value, name):
|
||||||
|
if value and not BATCH_RE.match(value):
|
||||||
|
raise HTTPException(400, '%s 参数不合法' % name)
|
||||||
|
return value
|
||||||
|
|
||||||
|
|
||||||
|
def check_time(value, name):
|
||||||
|
if not value:
|
||||||
|
return None
|
||||||
|
try:
|
||||||
|
return datetime.datetime.strptime(value, TIME_FMT)
|
||||||
|
except ValueError:
|
||||||
|
raise HTTPException(400, '%s 时间格式应为 %s' % (name, TIME_FMT))
|
||||||
|
|
||||||
|
|
||||||
|
def fmt_time(value):
|
||||||
|
return value.strftime(TIME_FMT) if value else None
|
||||||
|
|
||||||
|
|
||||||
|
def sql_text(value):
|
||||||
|
"""自由文本(关键词)拼进 SQL 前转义, 防单引号截断"""
|
||||||
|
return str(value).replace('\\', '\\\\').replace("'", "''")
|
||||||
|
|
||||||
|
|
||||||
|
def split_spu(value):
|
||||||
|
"""A 表里 spu_ids 是逗号拼接的串"""
|
||||||
|
return [spu for spu in (value or '').split(',') if spu]
|
||||||
|
|
||||||
|
|
||||||
|
def get_cache():
|
||||||
|
"""汇总视图和 A 表都很小, 一次读回来在内存里筛选聚合; rawdata 只在看单个券/关键词时才读"""
|
||||||
|
if table_cache['data'] and time.time() - table_cache['time'] < CACHE_SECONDS:
|
||||||
|
return table_cache['data']
|
||||||
|
|
||||||
|
coupon_sql = f'''
|
||||||
|
select item_id, store_id, coupon_id, coupon_name, type_doc, category, price, limit_text, condition_text,
|
||||||
|
use_doc, use_rules, tabId, is_ok, current_page, created_at, batch, store_name,
|
||||||
|
page_count, product_count, last_page, last_has_more, last_time, status from {COUPON_VIEW}
|
||||||
|
'''
|
||||||
|
coupon_rows = []
|
||||||
|
for row in tent.get_shoppingmalls(coupon_sql):
|
||||||
|
coupon_rows.append({
|
||||||
|
'id': row[0], 'store_id': row[1], 'coupon_id': row[2], 'name': row[3], 'type_doc': row[4],
|
||||||
|
'category': row[5], 'price': row[6], 'limit_text': row[7], 'condition_text': row[8],
|
||||||
|
'use_doc': row[9], 'use_rules': json.loads(row[10]), 'tabId': row[11], 'is_ok': row[12],
|
||||||
|
'current_page': row[13] or 0, 'created_at': row[14], 'batch': row[15], 'store_name': row[16],
|
||||||
|
'page_count': int(row[17] or 0), 'product_count': int(row[18] or 0), 'last_page': row[19],
|
||||||
|
'last_has_more': row[20], 'last_time': row[21], 'status': row[22],
|
||||||
|
})
|
||||||
|
|
||||||
|
keyword_sql = f'''
|
||||||
|
select task_id, batch, store_id, store_name, keyword, plan_page, current_page, total_num,
|
||||||
|
created_at, updated_at, saved_pages, product_count, last_time, status from {KEYWORD_VIEW}
|
||||||
|
'''
|
||||||
|
keyword_rows = []
|
||||||
|
for row in tent.get_shoppingmalls(keyword_sql):
|
||||||
|
keyword_rows.append({
|
||||||
|
'id': row[0], 'batch': row[1], 'store_id': row[2], 'store_name': row[3], 'keyword': row[4],
|
||||||
|
'page': int(row[5]), 'current_page': int(row[6] or 0), 'total_num': row[7],
|
||||||
|
'created_at': row[8], 'updated_at': row[9], 'saved_pages': int(row[10] or 0),
|
||||||
|
'product_count': int(row[11] or 0), 'last_time': row[12], 'status': row[13],
|
||||||
|
})
|
||||||
|
|
||||||
|
page_sql = f'''
|
||||||
|
select source, batch, store_id, biz_id, page, product_count, has_more, total_num, spu_ids, snapshot_time from {PAGE_TABLE}
|
||||||
|
'''
|
||||||
|
page_rows = []
|
||||||
|
for row in tent.get_shoppingmalls(page_sql):
|
||||||
|
page_rows.append({
|
||||||
|
'source': row[0], 'batch': row[1], 'store_id': row[2], 'biz_id': row[3], 'page': int(row[4]),
|
||||||
|
'product_count': int(row[5] or 0), 'has_more': int(row[6] or 0), 'total_num': row[7],
|
||||||
|
'spu_ids': row[8], 'time': row[9],
|
||||||
|
})
|
||||||
|
|
||||||
|
# (来源, 批次, 店铺, 券id或关键词) -> 该实体的全部页, 按页号排序
|
||||||
|
pages_by_key = {}
|
||||||
|
for row in page_rows:
|
||||||
|
pages_by_key.setdefault((row['source'], row['batch'], row['store_id'], row['biz_id']), []).append(row)
|
||||||
|
for rows in pages_by_key.values():
|
||||||
|
rows.sort(key=lambda x: x['page'])
|
||||||
|
|
||||||
|
# 店铺 -> 城市, 只有关键词任务表带城市
|
||||||
|
store_city = {}
|
||||||
|
for row in tent.get_shoppingmalls(f'select store_id, city from {INPUT_TABLE}'):
|
||||||
|
store_city[row[0]] = row[1]
|
||||||
|
|
||||||
|
data = {
|
||||||
|
'coupons': coupon_rows, 'keywords': keyword_rows, 'pages': page_rows,
|
||||||
|
'pages_by_key': pages_by_key, 'store_city': store_city,
|
||||||
|
}
|
||||||
|
table_cache['data'] = data
|
||||||
|
table_cache['time'] = time.time()
|
||||||
|
return data
|
||||||
|
|
||||||
|
|
||||||
|
def clean_product(item):
|
||||||
|
return {
|
||||||
|
'spu_id': str(item['spuId']), 'name': item['spuName'], 'picture': item['picture'],
|
||||||
|
'price': item['price'], 'origin_price': item['originPrice'], 'activity_price': item['activityPrice'],
|
||||||
|
'after_coupon': item['priceAfterCoupon'], 'unit': item['unit'],
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
def get_entity_products(table_name, biz_col, store_id, biz_id):
|
||||||
|
"""取单个券/关键词的原始页商品, 只查这一个实体.
|
||||||
|
清表重跑会留下同页多行, 按页号取最后写入的那行(id 最大)"""
|
||||||
|
check_text(store_id, 'store_id')
|
||||||
|
raw_sql = f'''
|
||||||
|
select page, snapshot_time, rawdata from {table_name} where store_id='{store_id}' and {biz_col}='{sql_text(biz_id)}' order by page, id
|
||||||
|
'''
|
||||||
|
page_dict = {}
|
||||||
|
for page_no, snapshot_time, rawdata in tent.get_shoppingmalls(raw_sql):
|
||||||
|
page_data = json.loads(rawdata)['data']
|
||||||
|
if table_name == COUPON_RAW:
|
||||||
|
# 券商品页的商品现在在 cards[].data 里(products 是空的), 老数据的页才在 products
|
||||||
|
items = [card['data'] for card in page_data['cards']]
|
||||||
|
if not items:
|
||||||
|
items = page_data['products']
|
||||||
|
products = [clean_product(item) for item in items]
|
||||||
|
has_more = page_data['hasMore']
|
||||||
|
total_num = None
|
||||||
|
else:
|
||||||
|
products = [clean_product(card['data']) for card in page_data['cards']]
|
||||||
|
has_more = page_data['hasNextPage']
|
||||||
|
total_num = page_data['totalNum']
|
||||||
|
page_dict[int(page_no)] = {
|
||||||
|
'page': int(page_no), 'time': fmt_time(snapshot_time), 'has_more': bool(has_more),
|
||||||
|
'total_num': total_num, 'products': products,
|
||||||
|
}
|
||||||
|
return [page_dict[key] for key in sorted(page_dict)]
|
||||||
|
|
||||||
|
|
||||||
|
def get_batches(data):
|
||||||
|
batch_set = set()
|
||||||
|
for name in ['pages', 'coupons', 'keywords']:
|
||||||
|
for row in data[name]:
|
||||||
|
batch_set.add(row['batch'])
|
||||||
|
return sorted(batch_set, reverse=True)
|
||||||
|
|
||||||
|
|
||||||
|
def get_filter(mode, batch, start, end, city, store_id):
|
||||||
|
"""mode=batch 按批次; mode=range 按 [start, end] 时间段; 都没给就取最新批次"""
|
||||||
|
check_text(batch, 'batch')
|
||||||
|
check_text(store_id, 'store_id')
|
||||||
|
start_time = check_time(start, 'start')
|
||||||
|
end_time = check_time(end, 'end')
|
||||||
|
data = get_cache()
|
||||||
|
if mode == 'range':
|
||||||
|
if not start_time or not end_time:
|
||||||
|
raise HTTPException(400, '时间段模式需要 start 和 end')
|
||||||
|
if start_time > end_time:
|
||||||
|
raise HTTPException(400, 'start 不能晚于 end')
|
||||||
|
return {'mode': 'range', 'batch': None, 'start': start_time, 'end': end_time, 'city': city, 'store_id': store_id}
|
||||||
|
batch_list = get_batches(data)
|
||||||
|
if not batch:
|
||||||
|
batch = batch_list[0] if batch_list else ''
|
||||||
|
return {'mode': 'batch', 'batch': batch, 'start': None, 'end': None, 'city': city, 'store_id': store_id}
|
||||||
|
|
||||||
|
|
||||||
|
def get_prev_filter(filter_data):
|
||||||
|
"""上一周期: 批次取前一个批次, 时间段取等长的前一段"""
|
||||||
|
if filter_data['mode'] == 'range':
|
||||||
|
span = filter_data['end'] - filter_data['start']
|
||||||
|
prev = dict(filter_data)
|
||||||
|
prev['end'] = filter_data['start'] - datetime.timedelta(seconds=1)
|
||||||
|
prev['start'] = prev['end'] - span
|
||||||
|
return prev
|
||||||
|
batch_list = get_batches(get_cache())
|
||||||
|
if filter_data['batch'] not in batch_list:
|
||||||
|
return None
|
||||||
|
index = batch_list.index(filter_data['batch'])
|
||||||
|
if index + 1 >= len(batch_list):
|
||||||
|
return None
|
||||||
|
prev = dict(filter_data)
|
||||||
|
prev['batch'] = batch_list[index + 1]
|
||||||
|
return prev
|
||||||
|
|
||||||
|
|
||||||
|
def match_store(filter_data, store_id, data):
|
||||||
|
if filter_data['store_id'] and store_id != filter_data['store_id']:
|
||||||
|
return False
|
||||||
|
if filter_data['city'] and data['store_city'].get(store_id) != filter_data['city']:
|
||||||
|
return False
|
||||||
|
return True
|
||||||
|
|
||||||
|
|
||||||
|
def in_time(filter_data, value):
|
||||||
|
return value is not None and filter_data['start'] <= value <= filter_data['end']
|
||||||
|
|
||||||
|
|
||||||
|
def pick_pages(filter_data, data, source):
|
||||||
|
"""按筛选取 coupon / search 的页"""
|
||||||
|
rows = []
|
||||||
|
for row in data['pages']:
|
||||||
|
if row['source'] != source:
|
||||||
|
continue
|
||||||
|
if not match_store(filter_data, row['store_id'], data):
|
||||||
|
continue
|
||||||
|
if filter_data['mode'] == 'batch' and row['batch'] != filter_data['batch']:
|
||||||
|
continue
|
||||||
|
if filter_data['mode'] == 'range' and not in_time(filter_data, row['time']):
|
||||||
|
continue
|
||||||
|
rows.append(row)
|
||||||
|
return rows
|
||||||
|
|
||||||
|
|
||||||
|
def get_coupon_pages(coupon, data):
|
||||||
|
"""某张券的全部已采页"""
|
||||||
|
return data['pages_by_key'].get(('coupon', coupon['batch'], coupon['store_id'], coupon['coupon_id']), [])
|
||||||
|
|
||||||
|
|
||||||
|
def get_keyword_pages(keyword_row, data):
|
||||||
|
"""某个关键词的全部已采页"""
|
||||||
|
return data['pages_by_key'].get(('search', keyword_row['batch'], keyword_row['store_id'], keyword_row['keyword']), [])
|
||||||
|
|
||||||
|
|
||||||
|
def pick_coupons(filter_data, data):
|
||||||
|
"""返回 [(券, 全部页, 筛选范围内的页)]"""
|
||||||
|
result = []
|
||||||
|
for coupon in data['coupons']:
|
||||||
|
if not match_store(filter_data, coupon['store_id'], data):
|
||||||
|
continue
|
||||||
|
if filter_data['mode'] == 'batch' and coupon['batch'] != filter_data['batch']:
|
||||||
|
continue
|
||||||
|
all_pages = get_coupon_pages(coupon, data)
|
||||||
|
if filter_data['mode'] == 'range':
|
||||||
|
range_pages = [row for row in all_pages if in_time(filter_data, row['time'])]
|
||||||
|
# 时间段: 券在段内没页, 但本身就是这段建的, 也算进来
|
||||||
|
if not range_pages and not in_time(filter_data, coupon['created_at']):
|
||||||
|
continue
|
||||||
|
else:
|
||||||
|
range_pages = all_pages
|
||||||
|
result.append((coupon, all_pages, range_pages))
|
||||||
|
return result
|
||||||
|
|
||||||
|
|
||||||
|
def pick_keywords(filter_data, data):
|
||||||
|
result = []
|
||||||
|
for row in data['keywords']:
|
||||||
|
if not match_store(filter_data, row['store_id'], data):
|
||||||
|
continue
|
||||||
|
if filter_data['mode'] == 'batch' and row['batch'] != filter_data['batch']:
|
||||||
|
continue
|
||||||
|
# 时间段: 任务在段内存在过且段内有过更新
|
||||||
|
if filter_data['mode'] == 'range' and not (row['created_at'] <= filter_data['end'] and row['updated_at'] >= filter_data['start']):
|
||||||
|
continue
|
||||||
|
result.append(row)
|
||||||
|
return result
|
||||||
|
|
||||||
|
|
||||||
|
def count_summary(filter_data, data):
|
||||||
|
coupon_list = pick_coupons(filter_data, data)
|
||||||
|
status_count = {'done': 0, 'empty': 0, 'running': 0, 'pending': 0}
|
||||||
|
coupon_pages = 0
|
||||||
|
coupon_products = 0
|
||||||
|
coupon_spu = set()
|
||||||
|
for coupon, all_pages, range_pages in coupon_list:
|
||||||
|
status_count[coupon['status']] += 1
|
||||||
|
coupon_pages += len(range_pages)
|
||||||
|
for row in range_pages:
|
||||||
|
coupon_products += row['product_count']
|
||||||
|
coupon_spu.update(split_spu(row['spu_ids']))
|
||||||
|
|
||||||
|
keyword_list = pick_keywords(filter_data, data)
|
||||||
|
keyword_count = {'done': 0, 'running': 0, 'pending': 0}
|
||||||
|
for row in keyword_list:
|
||||||
|
keyword_count[row['status']] += 1
|
||||||
|
|
||||||
|
search_rows = pick_pages(filter_data, data, 'search')
|
||||||
|
search_products = 0
|
||||||
|
search_spu = set()
|
||||||
|
for row in search_rows:
|
||||||
|
search_products += row['product_count']
|
||||||
|
search_spu.update(split_spu(row['spu_ids']))
|
||||||
|
|
||||||
|
# 时间段模式: 段内真有页入库的券才算段内采集过
|
||||||
|
if filter_data['mode'] == 'range':
|
||||||
|
coupon_collected = len([1 for _, _, range_pages in coupon_list if range_pages])
|
||||||
|
else:
|
||||||
|
coupon_collected = len(coupon_list) - status_count['pending']
|
||||||
|
|
||||||
|
return {
|
||||||
|
'coupon_total': len(coupon_list),
|
||||||
|
'coupon_collected': coupon_collected,
|
||||||
|
'coupon_status': status_count,
|
||||||
|
'coupon_pages': coupon_pages,
|
||||||
|
'coupon_products': coupon_products,
|
||||||
|
'coupon_spu': len(coupon_spu),
|
||||||
|
'keyword_total': len(keyword_list),
|
||||||
|
'keyword_status': keyword_count,
|
||||||
|
'search_pages': len(search_rows),
|
||||||
|
'search_products': search_products,
|
||||||
|
'search_spu': len(search_spu),
|
||||||
|
'product_spu': len(coupon_spu | search_spu),
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
def get_live(data):
|
||||||
|
"""最近一次页入库时间, 以及是否还在采集"""
|
||||||
|
time_list = [row['time'] for row in data['pages'] if row['time']]
|
||||||
|
if not time_list:
|
||||||
|
return {'last_time': None, 'live': False}
|
||||||
|
last_time = max(time_list)
|
||||||
|
return {'last_time': fmt_time(last_time), 'live': (datetime.datetime.now() - last_time).total_seconds() < LIVE_SECONDS}
|
||||||
|
|
||||||
|
|
||||||
|
@app.get('/api/meta')
|
||||||
|
def api_meta():
|
||||||
|
data = get_cache()
|
||||||
|
batch_list = []
|
||||||
|
for batch in get_batches(data):
|
||||||
|
time_list = [row['time'] for row in data['pages'] if row['batch'] == batch and row['time']]
|
||||||
|
time_list += [row['last_time'] for row in data['coupons'] if row['batch'] == batch and row['last_time']]
|
||||||
|
time_list += [row['updated_at'] for row in data['keywords'] if row['batch'] == batch and row['updated_at']]
|
||||||
|
batch_list.append({
|
||||||
|
'batch': batch,
|
||||||
|
'first_time': fmt_time(min(time_list)) if time_list else None,
|
||||||
|
'last_time': fmt_time(max(time_list)) if time_list else None,
|
||||||
|
})
|
||||||
|
store_dict = {}
|
||||||
|
for row in data['keywords'] + data['coupons']:
|
||||||
|
store_dict[row['store_id']] = {'store_id': row['store_id'], 'store_name': row['store_name'], 'city': data['store_city'].get(row['store_id'])}
|
||||||
|
city_list = sorted(set(store['city'] for store in store_dict.values() if store['city']))
|
||||||
|
return {'batches': batch_list, 'cities': city_list, 'stores': list(store_dict.values()), **get_live(data)}
|
||||||
|
|
||||||
|
|
||||||
|
@app.get('/api/summary')
|
||||||
|
def api_summary(mode: str = 'batch', batch: str = '', start: str = '', end: str = '', city: str = '', store_id: str = ''):
|
||||||
|
filter_data = get_filter(mode, batch, start, end, city, store_id)
|
||||||
|
data = get_cache()
|
||||||
|
prev_filter = get_prev_filter(filter_data)
|
||||||
|
return {
|
||||||
|
'current': count_summary(filter_data, data),
|
||||||
|
'prev': count_summary(prev_filter, data) if prev_filter else None,
|
||||||
|
'prev_label': (prev_filter['batch'] if prev_filter and prev_filter['mode'] == 'batch' else ('上一时段' if prev_filter else None)),
|
||||||
|
'batch': filter_data['batch'],
|
||||||
|
**get_live(data),
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@app.get('/api/timeline')
|
||||||
|
def api_timeline(mode: str = 'batch', batch: str = '', start: str = '', end: str = '', city: str = '', store_id: str = ''):
|
||||||
|
filter_data = get_filter(mode, batch, start, end, city, store_id)
|
||||||
|
data = get_cache()
|
||||||
|
coupon_rows = [row for _, _, range_pages in pick_coupons(filter_data, data) for row in range_pages]
|
||||||
|
search_rows = pick_pages(filter_data, data, 'search')
|
||||||
|
time_list = [row['time'] for row in coupon_rows + search_rows]
|
||||||
|
if filter_data['mode'] == 'range':
|
||||||
|
begin_time, end_time = filter_data['start'], filter_data['end']
|
||||||
|
elif time_list:
|
||||||
|
begin_time, end_time = min(time_list), max(time_list)
|
||||||
|
else:
|
||||||
|
return {'unit': 'hour', 'buckets': []}
|
||||||
|
# 跨度两天以内按小时, 否则按天
|
||||||
|
unit = 'hour' if (end_time - begin_time).total_seconds() <= 2 * 86400 else 'day'
|
||||||
|
if unit == 'hour':
|
||||||
|
cursor = begin_time.replace(minute=0, second=0, microsecond=0)
|
||||||
|
step = datetime.timedelta(hours=1)
|
||||||
|
key_fmt = '%Y-%m-%d %H:00'
|
||||||
|
else:
|
||||||
|
cursor = begin_time.replace(hour=0, minute=0, second=0, microsecond=0)
|
||||||
|
step = datetime.timedelta(days=1)
|
||||||
|
key_fmt = '%Y-%m-%d'
|
||||||
|
bucket_dict = {}
|
||||||
|
while cursor <= end_time:
|
||||||
|
bucket_dict[cursor.strftime(key_fmt)] = {'time': cursor.strftime(key_fmt), 'coupon_pages': 0, 'search_pages': 0}
|
||||||
|
cursor += step
|
||||||
|
for row in coupon_rows:
|
||||||
|
bucket_dict[row['time'].strftime(key_fmt)]['coupon_pages'] += 1
|
||||||
|
for row in search_rows:
|
||||||
|
bucket_dict[row['time'].strftime(key_fmt)]['search_pages'] += 1
|
||||||
|
return {'unit': unit, 'buckets': list(bucket_dict.values())}
|
||||||
|
|
||||||
|
|
||||||
|
@app.get('/api/coupons')
|
||||||
|
def api_coupons(mode: str = 'batch', batch: str = '', start: str = '', end: str = '', city: str = '', store_id: str = ''):
|
||||||
|
filter_data = get_filter(mode, batch, start, end, city, store_id)
|
||||||
|
data = get_cache()
|
||||||
|
coupon_list = pick_coupons(filter_data, data)
|
||||||
|
result = []
|
||||||
|
for coupon, all_pages, range_pages in coupon_list:
|
||||||
|
page_list = []
|
||||||
|
for row in all_pages:
|
||||||
|
page_list.append({
|
||||||
|
'page': row['page'], 'products': row['product_count'], 'time': fmt_time(row['time']),
|
||||||
|
'in_range': True if filter_data['mode'] == 'batch' else in_time(filter_data, row['time']),
|
||||||
|
})
|
||||||
|
result.append({
|
||||||
|
'id': coupon['id'], 'coupon_id': coupon['coupon_id'], 'name': coupon['name'],
|
||||||
|
'type_doc': coupon['type_doc'], 'category': coupon['category'], 'price': coupon['price'],
|
||||||
|
'limit_text': coupon['limit_text'], 'condition_text': coupon['condition_text'], 'use_doc': coupon['use_doc'],
|
||||||
|
'store_id': coupon['store_id'], 'store_name': coupon['store_name'], 'batch': coupon['batch'],
|
||||||
|
'status': coupon['status'], 'page_count': coupon['page_count'], 'product_count': coupon['product_count'],
|
||||||
|
'pages': page_list, 'last_time': fmt_time(coupon['last_time']),
|
||||||
|
})
|
||||||
|
return {'coupons': result}
|
||||||
|
|
||||||
|
|
||||||
|
@app.get('/api/coupons/{item_id}/pages')
|
||||||
|
def api_coupon_pages(item_id: int):
|
||||||
|
data = get_cache()
|
||||||
|
coupon_list = [coupon for coupon in data['coupons'] if coupon['id'] == item_id]
|
||||||
|
if not coupon_list:
|
||||||
|
raise HTTPException(404, '券不存在')
|
||||||
|
coupon = coupon_list[0]
|
||||||
|
page_list = get_entity_products(COUPON_RAW, 'coupon_id', coupon['store_id'], coupon['coupon_id'])
|
||||||
|
return {
|
||||||
|
'coupon': {
|
||||||
|
'id': coupon['id'], 'coupon_id': coupon['coupon_id'], 'name': coupon['name'], 'type_doc': coupon['type_doc'],
|
||||||
|
'price': coupon['price'], 'limit_text': coupon['limit_text'], 'condition_text': coupon['condition_text'],
|
||||||
|
'use_doc': coupon['use_doc'], 'use_rules': coupon['use_rules'], 'store_name': coupon['store_name'],
|
||||||
|
'batch': coupon['batch'], 'status': coupon['status'],
|
||||||
|
},
|
||||||
|
'pages': page_list,
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@app.get('/api/keywords')
|
||||||
|
def api_keywords(mode: str = 'batch', batch: str = '', start: str = '', end: str = '', city: str = '', store_id: str = ''):
|
||||||
|
filter_data = get_filter(mode, batch, start, end, city, store_id)
|
||||||
|
data = get_cache()
|
||||||
|
result = []
|
||||||
|
for row in pick_keywords(filter_data, data):
|
||||||
|
result.append({
|
||||||
|
'id': row['id'], 'keyword': row['keyword'], 'store_id': row['store_id'], 'store_name': row['store_name'],
|
||||||
|
'batch': row['batch'], 'page': row['page'], 'current_page': row['current_page'],
|
||||||
|
'total_num': row['total_num'], 'status': row['status'],
|
||||||
|
'saved_pages': row['saved_pages'], 'product_count': row['product_count'],
|
||||||
|
'updated_at': fmt_time(row['updated_at']),
|
||||||
|
})
|
||||||
|
return {'keywords': result}
|
||||||
|
|
||||||
|
|
||||||
|
@app.get('/api/keywords/{task_id}/pages')
|
||||||
|
def api_keyword_pages(task_id: int):
|
||||||
|
data = get_cache()
|
||||||
|
task_list = [row for row in data['keywords'] if row['id'] == task_id]
|
||||||
|
if not task_list:
|
||||||
|
raise HTTPException(404, '关键词任务不存在')
|
||||||
|
task_row = task_list[0]
|
||||||
|
page_list = get_entity_products(SEARCH_RAW, 'keyword', task_row['store_id'], task_row['keyword'])
|
||||||
|
return {
|
||||||
|
'keyword': {
|
||||||
|
'id': task_row['id'], 'keyword': task_row['keyword'], 'store_name': task_row['store_name'],
|
||||||
|
'batch': task_row['batch'], 'page': task_row['page'], 'current_page': task_row['current_page'],
|
||||||
|
'total_num': task_row['total_num'], 'status': task_row['status'],
|
||||||
|
},
|
||||||
|
'pages': page_list,
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
# 前端构建产物; 先 npm run build 再起服务
|
||||||
|
if os.path.isdir(WEB_DIR):
|
||||||
|
app.mount('/assets', StaticFiles(directory=os.path.join(WEB_DIR, 'assets')), name='assets')
|
||||||
|
|
||||||
|
@app.get('/{path:path}')
|
||||||
|
def web_index(path: str):
|
||||||
|
file_path = os.path.join(WEB_DIR, path)
|
||||||
|
if path and os.path.isfile(file_path) and os.path.abspath(file_path).startswith(os.path.abspath(WEB_DIR)):
|
||||||
|
return FileResponse(file_path)
|
||||||
|
return FileResponse(os.path.join(WEB_DIR, 'index.html'))
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
uvicorn.run(app, host='0.0.0.0', port=PORT)
|
||||||
Vendored
+62
File diff suppressed because one or more lines are too long
Vendored
+1
File diff suppressed because one or more lines are too long
Vendored
+14
@@ -0,0 +1,14 @@
|
|||||||
|
<!doctype html>
|
||||||
|
<html lang="zh-CN">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8" />
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
|
<meta name="referrer" content="no-referrer" />
|
||||||
|
<title>歪马送酒 · 采集看板</title>
|
||||||
|
<script type="module" crossorigin src="/assets/index-BWlKrTPj.js"></script>
|
||||||
|
<link rel="stylesheet" crossorigin href="/assets/index-BegkGVo7.css">
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="root"></div>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
<!doctype html>
|
||||||
|
<html lang="zh-CN">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8" />
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
|
<meta name="referrer" content="no-referrer" />
|
||||||
|
<title>歪马送酒 · 采集看板</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="root"></div>
|
||||||
|
<script type="module" src="/src/main.jsx"></script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
+16
@@ -0,0 +1,16 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
||||||
|
|
||||||
|
case `uname` in
|
||||||
|
*CYGWIN*|*MINGW*|*MSYS*)
|
||||||
|
if command -v cygpath > /dev/null 2>&1; then
|
||||||
|
basedir=`cygpath -w "$basedir"`
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
if [ -x "$basedir/node" ]; then
|
||||||
|
exec "$basedir/node" "$basedir/../nanoid/bin/nanoid.cjs" "$@"
|
||||||
|
else
|
||||||
|
exec node "$basedir/../nanoid/bin/nanoid.cjs" "$@"
|
||||||
|
fi
|
||||||
+17
@@ -0,0 +1,17 @@
|
|||||||
|
@ECHO off
|
||||||
|
GOTO start
|
||||||
|
:find_dp0
|
||||||
|
SET dp0=%~dp0
|
||||||
|
EXIT /b
|
||||||
|
:start
|
||||||
|
SETLOCAL
|
||||||
|
CALL :find_dp0
|
||||||
|
|
||||||
|
IF EXIST "%dp0%\node.exe" (
|
||||||
|
SET "_prog=%dp0%\node.exe"
|
||||||
|
) ELSE (
|
||||||
|
SET "_prog=node"
|
||||||
|
SET PATHEXT=%PATHEXT:;.JS;=;%
|
||||||
|
)
|
||||||
|
|
||||||
|
endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\nanoid\bin\nanoid.cjs" %*
|
||||||
+28
@@ -0,0 +1,28 @@
|
|||||||
|
#!/usr/bin/env pwsh
|
||||||
|
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
|
||||||
|
|
||||||
|
$exe=""
|
||||||
|
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
|
||||||
|
# Fix case when both the Windows and Linux builds of Node
|
||||||
|
# are installed in the same directory
|
||||||
|
$exe=".exe"
|
||||||
|
}
|
||||||
|
$ret=0
|
||||||
|
if (Test-Path "$basedir/node$exe") {
|
||||||
|
# Support pipeline input
|
||||||
|
if ($MyInvocation.ExpectingInput) {
|
||||||
|
$input | & "$basedir/node$exe" "$basedir/../nanoid/bin/nanoid.cjs" $args
|
||||||
|
} else {
|
||||||
|
& "$basedir/node$exe" "$basedir/../nanoid/bin/nanoid.cjs" $args
|
||||||
|
}
|
||||||
|
$ret=$LASTEXITCODE
|
||||||
|
} else {
|
||||||
|
# Support pipeline input
|
||||||
|
if ($MyInvocation.ExpectingInput) {
|
||||||
|
$input | & "node$exe" "$basedir/../nanoid/bin/nanoid.cjs" $args
|
||||||
|
} else {
|
||||||
|
& "node$exe" "$basedir/../nanoid/bin/nanoid.cjs" $args
|
||||||
|
}
|
||||||
|
$ret=$LASTEXITCODE
|
||||||
|
}
|
||||||
|
exit $ret
|
||||||
+16
@@ -0,0 +1,16 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
||||||
|
|
||||||
|
case `uname` in
|
||||||
|
*CYGWIN*|*MINGW*|*MSYS*)
|
||||||
|
if command -v cygpath > /dev/null 2>&1; then
|
||||||
|
basedir=`cygpath -w "$basedir"`
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
if [ -x "$basedir/node" ]; then
|
||||||
|
exec "$basedir/node" "$basedir/../rolldown/bin/cli.mjs" "$@"
|
||||||
|
else
|
||||||
|
exec node "$basedir/../rolldown/bin/cli.mjs" "$@"
|
||||||
|
fi
|
||||||
+17
@@ -0,0 +1,17 @@
|
|||||||
|
@ECHO off
|
||||||
|
GOTO start
|
||||||
|
:find_dp0
|
||||||
|
SET dp0=%~dp0
|
||||||
|
EXIT /b
|
||||||
|
:start
|
||||||
|
SETLOCAL
|
||||||
|
CALL :find_dp0
|
||||||
|
|
||||||
|
IF EXIST "%dp0%\node.exe" (
|
||||||
|
SET "_prog=%dp0%\node.exe"
|
||||||
|
) ELSE (
|
||||||
|
SET "_prog=node"
|
||||||
|
SET PATHEXT=%PATHEXT:;.JS;=;%
|
||||||
|
)
|
||||||
|
|
||||||
|
endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\rolldown\bin\cli.mjs" %*
|
||||||
+28
@@ -0,0 +1,28 @@
|
|||||||
|
#!/usr/bin/env pwsh
|
||||||
|
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
|
||||||
|
|
||||||
|
$exe=""
|
||||||
|
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
|
||||||
|
# Fix case when both the Windows and Linux builds of Node
|
||||||
|
# are installed in the same directory
|
||||||
|
$exe=".exe"
|
||||||
|
}
|
||||||
|
$ret=0
|
||||||
|
if (Test-Path "$basedir/node$exe") {
|
||||||
|
# Support pipeline input
|
||||||
|
if ($MyInvocation.ExpectingInput) {
|
||||||
|
$input | & "$basedir/node$exe" "$basedir/../rolldown/bin/cli.mjs" $args
|
||||||
|
} else {
|
||||||
|
& "$basedir/node$exe" "$basedir/../rolldown/bin/cli.mjs" $args
|
||||||
|
}
|
||||||
|
$ret=$LASTEXITCODE
|
||||||
|
} else {
|
||||||
|
# Support pipeline input
|
||||||
|
if ($MyInvocation.ExpectingInput) {
|
||||||
|
$input | & "node$exe" "$basedir/../rolldown/bin/cli.mjs" $args
|
||||||
|
} else {
|
||||||
|
& "node$exe" "$basedir/../rolldown/bin/cli.mjs" $args
|
||||||
|
}
|
||||||
|
$ret=$LASTEXITCODE
|
||||||
|
}
|
||||||
|
exit $ret
|
||||||
+16
@@ -0,0 +1,16 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
||||||
|
|
||||||
|
case `uname` in
|
||||||
|
*CYGWIN*|*MINGW*|*MSYS*)
|
||||||
|
if command -v cygpath > /dev/null 2>&1; then
|
||||||
|
basedir=`cygpath -w "$basedir"`
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
if [ -x "$basedir/node" ]; then
|
||||||
|
exec "$basedir/node" "$basedir/../vite/bin/vite.js" "$@"
|
||||||
|
else
|
||||||
|
exec node "$basedir/../vite/bin/vite.js" "$@"
|
||||||
|
fi
|
||||||
+17
@@ -0,0 +1,17 @@
|
|||||||
|
@ECHO off
|
||||||
|
GOTO start
|
||||||
|
:find_dp0
|
||||||
|
SET dp0=%~dp0
|
||||||
|
EXIT /b
|
||||||
|
:start
|
||||||
|
SETLOCAL
|
||||||
|
CALL :find_dp0
|
||||||
|
|
||||||
|
IF EXIST "%dp0%\node.exe" (
|
||||||
|
SET "_prog=%dp0%\node.exe"
|
||||||
|
) ELSE (
|
||||||
|
SET "_prog=node"
|
||||||
|
SET PATHEXT=%PATHEXT:;.JS;=;%
|
||||||
|
)
|
||||||
|
|
||||||
|
endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\vite\bin\vite.js" %*
|
||||||
+28
@@ -0,0 +1,28 @@
|
|||||||
|
#!/usr/bin/env pwsh
|
||||||
|
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
|
||||||
|
|
||||||
|
$exe=""
|
||||||
|
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
|
||||||
|
# Fix case when both the Windows and Linux builds of Node
|
||||||
|
# are installed in the same directory
|
||||||
|
$exe=".exe"
|
||||||
|
}
|
||||||
|
$ret=0
|
||||||
|
if (Test-Path "$basedir/node$exe") {
|
||||||
|
# Support pipeline input
|
||||||
|
if ($MyInvocation.ExpectingInput) {
|
||||||
|
$input | & "$basedir/node$exe" "$basedir/../vite/bin/vite.js" $args
|
||||||
|
} else {
|
||||||
|
& "$basedir/node$exe" "$basedir/../vite/bin/vite.js" $args
|
||||||
|
}
|
||||||
|
$ret=$LASTEXITCODE
|
||||||
|
} else {
|
||||||
|
# Support pipeline input
|
||||||
|
if ($MyInvocation.ExpectingInput) {
|
||||||
|
$input | & "node$exe" "$basedir/../vite/bin/vite.js" $args
|
||||||
|
} else {
|
||||||
|
& "node$exe" "$basedir/../vite/bin/vite.js" $args
|
||||||
|
}
|
||||||
|
$ret=$LASTEXITCODE
|
||||||
|
}
|
||||||
|
exit $ret
|
||||||
+410
@@ -0,0 +1,410 @@
|
|||||||
|
{
|
||||||
|
"name": "waima-dashboard",
|
||||||
|
"version": "0.1.0",
|
||||||
|
"lockfileVersion": 3,
|
||||||
|
"requires": true,
|
||||||
|
"packages": {
|
||||||
|
"node_modules/@oxc-project/types": {
|
||||||
|
"version": "0.153.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@oxc-project/types/-/types-0.153.0.tgz",
|
||||||
|
"integrity": "sha512-jSNrRIyvPVLL5E1z/tS5zLAprosGz/FuI1PWwEOz59j3E4TTTzSpqKb/RDGqJhhW0QHYISGXxq582wGx6T11Tw==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/sponsors/oxc-project"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@rolldown/binding-win32-x64-msvc": {
|
||||||
|
"version": "1.2.13",
|
||||||
|
"resolved": "https://registry.npmjs.org/@rolldown/binding-win32-x64-msvc/-/binding-win32-x64-msvc-1.2.13.tgz",
|
||||||
|
"integrity": "sha512-UKhFaZTeTcbKrb3iU82m17jVcPEAoqDkCN5MBqgPyZSwp/cQmib21crTS0DdH7T1B7wZRWEI89YQAOJMet5yhg==",
|
||||||
|
"cpu": [
|
||||||
|
"x64"
|
||||||
|
],
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"optional": true,
|
||||||
|
"os": [
|
||||||
|
"win32"
|
||||||
|
],
|
||||||
|
"engines": {
|
||||||
|
"node": "^20.19.0 || >=22.12.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@rolldown/pluginutils": {
|
||||||
|
"version": "1.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/@rolldown/pluginutils/-/pluginutils-1.0.1.tgz",
|
||||||
|
"integrity": "sha512-2j9bGt5Jh8hj+vPtgzPtl72j0yRxHAyumoo6TNfAjsLB04UtpSvPbPcDcBMxz7n+9CYB0c1GxQFxYRg2jimqGw==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT"
|
||||||
|
},
|
||||||
|
"node_modules/@vitejs/plugin-react": {
|
||||||
|
"version": "6.1.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/@vitejs/plugin-react/-/plugin-react-6.1.2.tgz",
|
||||||
|
"integrity": "sha512-fhJNGUdscQa4HkI0xFxwonWyhnVReCPDbXI7FH7jmzpnVCrFQI7PRrhWecO263610vOrs9tr2Y4xcf8uAdFxbw==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"@rolldown/pluginutils": "^1.0.1"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": "^20.19.0 || >=22.12.0"
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"@rolldown/plugin-babel": "^0.1.7 || ^0.2.0",
|
||||||
|
"babel-plugin-react-compiler": "^1.0.0",
|
||||||
|
"oxc-transform-react": "^0.152.0",
|
||||||
|
"vite": "^8.0.0"
|
||||||
|
},
|
||||||
|
"peerDependenciesMeta": {
|
||||||
|
"@rolldown/plugin-babel": {
|
||||||
|
"optional": true
|
||||||
|
},
|
||||||
|
"babel-plugin-react-compiler": {
|
||||||
|
"optional": true
|
||||||
|
},
|
||||||
|
"oxc-transform-react": {
|
||||||
|
"optional": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/detect-libc": {
|
||||||
|
"version": "2.1.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.1.2.tgz",
|
||||||
|
"integrity": "sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "Apache-2.0",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=8"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/echarts": {
|
||||||
|
"version": "6.1.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/echarts/-/echarts-6.1.0.tgz",
|
||||||
|
"integrity": "sha512-q0yaFPggC9FUdsWH4blavRWFmxdrIodbkoKNAjJudAI6CA9gNPxHtV2RcZNEepZVlk4yvBYkOkbk6HIVpIyHZA==",
|
||||||
|
"license": "Apache-2.0",
|
||||||
|
"dependencies": {
|
||||||
|
"tslib": "2.3.0",
|
||||||
|
"zrender": "6.1.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/fdir": {
|
||||||
|
"version": "6.5.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/fdir/-/fdir-6.5.0.tgz",
|
||||||
|
"integrity": "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=12.0.0"
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"picomatch": "^3 || ^4"
|
||||||
|
},
|
||||||
|
"peerDependenciesMeta": {
|
||||||
|
"picomatch": {
|
||||||
|
"optional": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/lightningcss": {
|
||||||
|
"version": "1.33.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/lightningcss/-/lightningcss-1.33.0.tgz",
|
||||||
|
"integrity": "sha512-WkUDrojuJs0xkgGf2udWxa3yGBRxPtxUkB79i6aCZLRgc7PM8fZe9TosfPDcvEpQZbuFASnHYmRLBLUbmLOIIA==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MPL-2.0",
|
||||||
|
"dependencies": {
|
||||||
|
"detect-libc": "^2.0.3"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 12.0.0"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"type": "opencollective",
|
||||||
|
"url": "https://opencollective.com/parcel"
|
||||||
|
},
|
||||||
|
"optionalDependencies": {
|
||||||
|
"lightningcss-android-arm64": "1.33.0",
|
||||||
|
"lightningcss-darwin-arm64": "1.33.0",
|
||||||
|
"lightningcss-darwin-x64": "1.33.0",
|
||||||
|
"lightningcss-freebsd-x64": "1.33.0",
|
||||||
|
"lightningcss-linux-arm-gnueabihf": "1.33.0",
|
||||||
|
"lightningcss-linux-arm64-gnu": "1.33.0",
|
||||||
|
"lightningcss-linux-arm64-musl": "1.33.0",
|
||||||
|
"lightningcss-linux-x64-gnu": "1.33.0",
|
||||||
|
"lightningcss-linux-x64-musl": "1.33.0",
|
||||||
|
"lightningcss-win32-arm64-msvc": "1.33.0",
|
||||||
|
"lightningcss-win32-x64-msvc": "1.33.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/lightningcss-win32-x64-msvc": {
|
||||||
|
"version": "1.33.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/lightningcss-win32-x64-msvc/-/lightningcss-win32-x64-msvc-1.33.0.tgz",
|
||||||
|
"integrity": "sha512-OlEICDx/Xl0FqSp4bry8zFnCvGpig3Gl4gCquvYwHuqJKEC1+n9NgDniFvqHGmMv1ZkqDJrDqKKSykTDX+ehuA==",
|
||||||
|
"cpu": [
|
||||||
|
"x64"
|
||||||
|
],
|
||||||
|
"dev": true,
|
||||||
|
"license": "MPL-2.0",
|
||||||
|
"optional": true,
|
||||||
|
"os": [
|
||||||
|
"win32"
|
||||||
|
],
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 12.0.0"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"type": "opencollective",
|
||||||
|
"url": "https://opencollective.com/parcel"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/nanoid": {
|
||||||
|
"version": "3.3.20",
|
||||||
|
"resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.20.tgz",
|
||||||
|
"integrity": "sha512-uKdg2G3GNCKQn9byYOpxbGqrT2fGO5KRt5J/8b3pok8rT6qxGWF6hxMyJiEYtAf+FVyYuD9hRaDqX5uPFYJ4ZQ==",
|
||||||
|
"dev": true,
|
||||||
|
"funding": [
|
||||||
|
{
|
||||||
|
"type": "github",
|
||||||
|
"url": "https://github.com/sponsors/ai"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"license": "MIT",
|
||||||
|
"bin": {
|
||||||
|
"nanoid": "bin/nanoid.cjs"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/picocolors": {
|
||||||
|
"version": "1.1.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz",
|
||||||
|
"integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "ISC"
|
||||||
|
},
|
||||||
|
"node_modules/picomatch": {
|
||||||
|
"version": "4.0.7",
|
||||||
|
"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.7.tgz",
|
||||||
|
"integrity": "sha512-qcJu88Q2IWqJsDD529JKMdwGm/dvInW4HvQnRwiH9JtihJvzGOscDtHE3x1pBKeUOTysQ8kVmLnJ2kJu7yhcGA==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=12"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/sponsors/jonschlinkert"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/postcss": {
|
||||||
|
"version": "8.5.29",
|
||||||
|
"resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.29.tgz",
|
||||||
|
"integrity": "sha512-49cGhUbXj8Qenv0iTMxA1cFBzxXoctpC9Ujd77t1WcbJIr6nF/eI7g/8MgxrYldFRuAXvja7xQRwavoW7kgrxQ==",
|
||||||
|
"dev": true,
|
||||||
|
"funding": [
|
||||||
|
{
|
||||||
|
"type": "opencollective",
|
||||||
|
"url": "https://opencollective.com/postcss/"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "tidelift",
|
||||||
|
"url": "https://tidelift.com/funding/github/npm/postcss"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "github",
|
||||||
|
"url": "https://github.com/sponsors/ai"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"nanoid": "^3.3.19",
|
||||||
|
"picocolors": "^1.1.1",
|
||||||
|
"source-map-js": "^1.2.2"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": "^10 || ^12 || >=14"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/react": {
|
||||||
|
"version": "19.3.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/react/-/react-19.3.0.tgz",
|
||||||
|
"integrity": "sha512-E8LUcbtBWt20bbl2YoHfx4ZDBdxVTfOKtCZn9cDSJ4l6/nuoApcpIBcj47t2wZoVX8g2ZHuMHbiShgCR1T5Sog==",
|
||||||
|
"license": "MIT",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=0.10.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/react-dom": {
|
||||||
|
"version": "19.3.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/react-dom/-/react-dom-19.3.0.tgz",
|
||||||
|
"integrity": "sha512-JDk8dgif51OjFoDE70+OT9ICyYr+69HlmihNwp1+Nsfbna3t5sIiCa9ZJktDmQ4/1b/rn26hIAR2uYXDMr5r0Q==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"scheduler": "^0.28.0"
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"react": "^19.3.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/rolldown": {
|
||||||
|
"version": "1.2.13",
|
||||||
|
"resolved": "https://registry.npmjs.org/rolldown/-/rolldown-1.2.13.tgz",
|
||||||
|
"integrity": "sha512-/5apOkwWxtACcQtZ5WlrAsKS4JwXVThQPJZ3RqIruRY9UG9M8e0VlXN068xum/JRKA4aIUoJ13ghe/kGCvidiQ==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"@oxc-project/types": "=0.153.0",
|
||||||
|
"@rolldown/pluginutils": "^1.0.0"
|
||||||
|
},
|
||||||
|
"bin": {
|
||||||
|
"rolldown": "bin/cli.mjs"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": "^20.19.0 || >=22.12.0"
|
||||||
|
},
|
||||||
|
"optionalDependencies": {
|
||||||
|
"@rolldown/binding-android-arm-eabi": "1.2.13",
|
||||||
|
"@rolldown/binding-android-arm64": "1.2.13",
|
||||||
|
"@rolldown/binding-darwin-arm64": "1.2.13",
|
||||||
|
"@rolldown/binding-darwin-x64": "1.2.13",
|
||||||
|
"@rolldown/binding-freebsd-x64": "1.2.13",
|
||||||
|
"@rolldown/binding-linux-arm-gnueabihf": "1.2.13",
|
||||||
|
"@rolldown/binding-linux-arm64-gnu": "1.2.13",
|
||||||
|
"@rolldown/binding-linux-arm64-musl": "1.2.13",
|
||||||
|
"@rolldown/binding-linux-ppc64-gnu": "1.2.13",
|
||||||
|
"@rolldown/binding-linux-s390x-gnu": "1.2.13",
|
||||||
|
"@rolldown/binding-linux-x64-gnu": "1.2.13",
|
||||||
|
"@rolldown/binding-linux-x64-musl": "1.2.13",
|
||||||
|
"@rolldown/binding-openharmony-arm64": "1.2.13",
|
||||||
|
"@rolldown/binding-win32-arm64-msvc": "1.2.13",
|
||||||
|
"@rolldown/binding-win32-x64-msvc": "1.2.13"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/scheduler": {
|
||||||
|
"version": "0.28.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.28.0.tgz",
|
||||||
|
"integrity": "sha512-juorfCmIkIw8tT+p5BXSm6PJjQF/ycEYmKyzURCIt/RaZIhL+PulbQ9Yu2z1HdOJDdqDTlxA1+xKBmHXJsczAw==",
|
||||||
|
"license": "MIT"
|
||||||
|
},
|
||||||
|
"node_modules/source-map-js": {
|
||||||
|
"version": "1.2.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.2.tgz",
|
||||||
|
"integrity": "sha512-KGj/8Y43x35aZVDtt+J4mK1hoLGHULMYfSkODJNQjNDC3oW1PqPoxMwo0pLUsWM/UEGzON/NxeHywEfNXNP3Vw==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "BSD-3-Clause",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=0.10.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/tinyglobby": {
|
||||||
|
"version": "0.2.17",
|
||||||
|
"resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.17.tgz",
|
||||||
|
"integrity": "sha512-wXR/dYpcqKmfWpEdZjiKJOwCNFndD0DMnrW/cYjVGttEkBfVgcLFHoNrlj47mjOVic9yyNu65alsgF4NQyTa2g==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"fdir": "^6.5.0",
|
||||||
|
"picomatch": "^4.0.4"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=12.0.0"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/sponsors/SuperchupuDev"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/tslib": {
|
||||||
|
"version": "2.3.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.0.tgz",
|
||||||
|
"integrity": "sha512-N82ooyxVNm6h1riLCoyS9e3fuJ3AMG2zIZs2Gd1ATcSFjSA23Q0fzjjZeh0jbJvWVDZ0cJT8yaNNaaXHzueNjg==",
|
||||||
|
"license": "0BSD"
|
||||||
|
},
|
||||||
|
"node_modules/vite": {
|
||||||
|
"version": "8.3.4",
|
||||||
|
"resolved": "https://registry.npmjs.org/vite/-/vite-8.3.4.tgz",
|
||||||
|
"integrity": "sha512-IftLE8phJhdNRIGNEV4JCCvfNScoZQVfcXaN8TQropWGJtOHcu+iAB9pHcuGvmEb/kddw0LBe/jS8ztdC6xdiQ==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"lightningcss": "^1.33.0",
|
||||||
|
"picomatch": "^4.0.7",
|
||||||
|
"postcss": "^8.5.29",
|
||||||
|
"rolldown": "~1.2.12",
|
||||||
|
"tinyglobby": "^0.2.17"
|
||||||
|
},
|
||||||
|
"bin": {
|
||||||
|
"vite": "bin/vite.js"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": "^20.19.0 || >=22.12.0"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/vitejs/vite?sponsor=1"
|
||||||
|
},
|
||||||
|
"optionalDependencies": {
|
||||||
|
"fsevents": "~2.3.3"
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"@types/node": "^20.19.0 || >=22.12.0",
|
||||||
|
"@vitejs/devtools": "^0.7.1",
|
||||||
|
"esbuild": "^0.27.0 || ^0.28.0",
|
||||||
|
"jiti": ">=1.21.0",
|
||||||
|
"less": "^4.0.0",
|
||||||
|
"sass": "^1.70.0",
|
||||||
|
"sass-embedded": "^1.70.0",
|
||||||
|
"stylus": ">=0.54.8",
|
||||||
|
"sugarss": "^5.0.0",
|
||||||
|
"terser": "^5.16.0",
|
||||||
|
"tsx": "^4.8.1",
|
||||||
|
"yaml": "^2.4.2"
|
||||||
|
},
|
||||||
|
"peerDependenciesMeta": {
|
||||||
|
"@types/node": {
|
||||||
|
"optional": true
|
||||||
|
},
|
||||||
|
"@vitejs/devtools": {
|
||||||
|
"optional": true
|
||||||
|
},
|
||||||
|
"esbuild": {
|
||||||
|
"optional": true
|
||||||
|
},
|
||||||
|
"jiti": {
|
||||||
|
"optional": true
|
||||||
|
},
|
||||||
|
"less": {
|
||||||
|
"optional": true
|
||||||
|
},
|
||||||
|
"sass": {
|
||||||
|
"optional": true
|
||||||
|
},
|
||||||
|
"sass-embedded": {
|
||||||
|
"optional": true
|
||||||
|
},
|
||||||
|
"stylus": {
|
||||||
|
"optional": true
|
||||||
|
},
|
||||||
|
"sugarss": {
|
||||||
|
"optional": true
|
||||||
|
},
|
||||||
|
"terser": {
|
||||||
|
"optional": true
|
||||||
|
},
|
||||||
|
"tsx": {
|
||||||
|
"optional": true
|
||||||
|
},
|
||||||
|
"yaml": {
|
||||||
|
"optional": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/zrender": {
|
||||||
|
"version": "6.1.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/zrender/-/zrender-6.1.0.tgz",
|
||||||
|
"integrity": "sha512-oEGMDB6pOP2S6OwRR4PdVv610zrjnA3Bh+JnSG12fYJlBKjtNAoEb5fSUoCOOINlH96I2fU38/A2UpRKs67xYQ==",
|
||||||
|
"license": "BSD-3-Clause",
|
||||||
|
"dependencies": {
|
||||||
|
"tslib": "2.3.0"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
+22
@@ -0,0 +1,22 @@
|
|||||||
|
MIT License
|
||||||
|
|
||||||
|
Copyright (c) 2024-present VoidZero Inc. & Contributors
|
||||||
|
Copyright (c) 2023 Boshen
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
||||||
+3
@@ -0,0 +1,3 @@
|
|||||||
|
# Oxc Types
|
||||||
|
|
||||||
|
Typescript definitions for Oxc AST nodes.
|
||||||
+26
@@ -0,0 +1,26 @@
|
|||||||
|
{
|
||||||
|
"name": "@oxc-project/types",
|
||||||
|
"version": "0.153.0",
|
||||||
|
"description": "Types for Oxc AST nodes",
|
||||||
|
"keywords": [
|
||||||
|
"AST",
|
||||||
|
"Parser"
|
||||||
|
],
|
||||||
|
"homepage": "https://oxc.rs",
|
||||||
|
"bugs": "https://github.com/oxc-project/oxc/issues",
|
||||||
|
"license": "MIT",
|
||||||
|
"author": "Boshen and oxc contributors",
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "git+https://github.com/oxc-project/oxc.git",
|
||||||
|
"directory": "npm/oxc-types"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/sponsors/oxc-project"
|
||||||
|
},
|
||||||
|
"files": [
|
||||||
|
"types.d.ts"
|
||||||
|
],
|
||||||
|
"type": "module",
|
||||||
|
"types": "types.d.ts"
|
||||||
|
}
|
||||||
+1912
File diff suppressed because it is too large
Load Diff
+3
@@ -0,0 +1,3 @@
|
|||||||
|
# `@rolldown/binding-win32-x64-msvc`
|
||||||
|
|
||||||
|
This is the **x86_64-pc-windows-msvc** binary for `@rolldown/binding`
|
||||||
+40
@@ -0,0 +1,40 @@
|
|||||||
|
{
|
||||||
|
"name": "@rolldown/binding-win32-x64-msvc",
|
||||||
|
"version": "1.2.13",
|
||||||
|
"cpu": [
|
||||||
|
"x64"
|
||||||
|
],
|
||||||
|
"main": "rolldown-binding.win32-x64-msvc.node",
|
||||||
|
"files": [
|
||||||
|
"rolldown-binding.win32-x64-msvc.node"
|
||||||
|
],
|
||||||
|
"description": "Fast JavaScript/TypeScript bundler in Rust with Rollup-compatible API.",
|
||||||
|
"keywords": [
|
||||||
|
"bundler",
|
||||||
|
"esbuild",
|
||||||
|
"parcel",
|
||||||
|
"rolldown",
|
||||||
|
"rollup",
|
||||||
|
"webpack"
|
||||||
|
],
|
||||||
|
"homepage": "https://rolldown.rs/",
|
||||||
|
"license": "MIT",
|
||||||
|
"engines": {
|
||||||
|
"node": "^20.19.0 || >=22.12.0"
|
||||||
|
},
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "git+https://github.com/rolldown/rolldown.git",
|
||||||
|
"directory": "packages/rolldown"
|
||||||
|
},
|
||||||
|
"bugs": {
|
||||||
|
"url": "https://github.com/rolldown/rolldown/issues"
|
||||||
|
},
|
||||||
|
"publishConfig": {
|
||||||
|
"registry": "https://registry.npmjs.org/",
|
||||||
|
"access": "public"
|
||||||
|
},
|
||||||
|
"os": [
|
||||||
|
"win32"
|
||||||
|
]
|
||||||
|
}
|
||||||
Generated
Vendored
BIN
Binary file not shown.
+21
@@ -0,0 +1,21 @@
|
|||||||
|
MIT License
|
||||||
|
|
||||||
|
Copyright (c) 2026-present, rolldown/plugins repository contributors
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
||||||
+145
@@ -0,0 +1,145 @@
|
|||||||
|
# @rolldown/pluginutils [](https://npmx.dev/package/@rolldown/pluginutils)
|
||||||
|
|
||||||
|
Plugin utilities for [Rolldown](https://rolldown.rs).
|
||||||
|
|
||||||
|
Includes regex helpers for plugin hook filters, composable filter expressions, and a helper for filtering out Vite-serve-only plugins.
|
||||||
|
|
||||||
|
## Install
|
||||||
|
|
||||||
|
```bash
|
||||||
|
pnpm add -D @rolldown/pluginutils
|
||||||
|
```
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
```ts
|
||||||
|
import { exactRegex, prefixRegex, makeIdFiltersToMatchWithQuery } from '@rolldown/pluginutils'
|
||||||
|
```
|
||||||
|
|
||||||
|
All filter helpers are also exposed via the `/filter` subpath:
|
||||||
|
|
||||||
|
```ts
|
||||||
|
import { and, or, id, include } from '@rolldown/pluginutils/filter'
|
||||||
|
```
|
||||||
|
|
||||||
|
## Regex helpers
|
||||||
|
|
||||||
|
### `exactRegex`
|
||||||
|
|
||||||
|
- **Type:** `(str: string, flags?: string) => RegExp`
|
||||||
|
|
||||||
|
Constructs a `RegExp` that matches the exact string specified. Useful as a plugin hook filter.
|
||||||
|
|
||||||
|
```ts
|
||||||
|
import { exactRegex } from '@rolldown/pluginutils'
|
||||||
|
|
||||||
|
const plugin = {
|
||||||
|
name: 'plugin',
|
||||||
|
resolveId: {
|
||||||
|
filter: { id: exactRegex('foo') },
|
||||||
|
handler(id) {}, // only called for `foo`
|
||||||
|
},
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### `prefixRegex`
|
||||||
|
|
||||||
|
- **Type:** `(str: string, flags?: string) => RegExp`
|
||||||
|
|
||||||
|
Constructs a `RegExp` that matches values starting with the specified prefix.
|
||||||
|
|
||||||
|
```ts
|
||||||
|
import { prefixRegex } from '@rolldown/pluginutils'
|
||||||
|
|
||||||
|
const plugin = {
|
||||||
|
name: 'plugin',
|
||||||
|
resolveId: {
|
||||||
|
filter: { id: prefixRegex('foo') },
|
||||||
|
handler(id) {}, // called for IDs starting with `foo`
|
||||||
|
},
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### `makeIdFiltersToMatchWithQuery`
|
||||||
|
|
||||||
|
- **Type:** `(input: string | RegExp | (string | RegExp)[]) => string | RegExp | (string | RegExp)[]`
|
||||||
|
|
||||||
|
Converts an id filter so that it also matches ids that include a query string.
|
||||||
|
|
||||||
|
```ts
|
||||||
|
import { makeIdFiltersToMatchWithQuery } from '@rolldown/pluginutils'
|
||||||
|
|
||||||
|
const plugin = {
|
||||||
|
name: 'plugin',
|
||||||
|
transform: {
|
||||||
|
filter: { id: makeIdFiltersToMatchWithQuery(['**/*.js', /\.ts$/]) },
|
||||||
|
// Matches:
|
||||||
|
// foo.js, foo.js?foo, foo.txt?foo.js,
|
||||||
|
// foo.ts, foo.ts?foo, foo.txt?foo.ts
|
||||||
|
handler(code, id) {},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Composable filters
|
||||||
|
|
||||||
|
[Composable filter expressions](https://rolldown.rs/apis/plugin-api/hook-filters#composable-filters) for use cases where a simple `id`/`include`/`exclude` is not enough. For example, when a plugin needs to combine `id`, `moduleType`, `code`, and `query` conditions.
|
||||||
|
|
||||||
|
```ts
|
||||||
|
import { and, code, id, include, interpreter, moduleType, or } from '@rolldown/pluginutils'
|
||||||
|
|
||||||
|
const expr = include(and(or(id(/\.tsx?$/), id(/\.jsx?$/)), moduleType('tsx'), code(/import React/)))
|
||||||
|
|
||||||
|
interpreter(expr, sourceCode, sourceId, 'tsx') // boolean
|
||||||
|
```
|
||||||
|
|
||||||
|
### Builders
|
||||||
|
|
||||||
|
| Builder | Description |
|
||||||
|
| ------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||||
|
| `and(...exprs)` | All operands must match. |
|
||||||
|
| `or(...exprs)` | At least one operand must match. |
|
||||||
|
| `not(expr)` | Negates the operand. |
|
||||||
|
| `id(pattern, params?)` | Match the module id. `pattern` is `string` or `RegExp`. `params.cleanUrl` strips the query/hash before matching. |
|
||||||
|
| `importerId(pattern, params?)` | Match the importer's id. Same shape as `id`. |
|
||||||
|
| `moduleType(type)` | Match Rolldown's module type (`'js'`, `'jsx'`, `'ts'`, `'tsx'`, `'json'`, `'text'`, `'base64'`, `'dataurl'`, `'binary'`, `'empty'`, or a custom string). |
|
||||||
|
| `code(pattern)` | Match the module source. `string` matches with `includes`; `RegExp` with `test`. |
|
||||||
|
| `query(key, pattern)` | Match a single query parameter. `pattern` is `boolean` (key presence/truthiness), `string` (exact value), or `RegExp` (value pattern). |
|
||||||
|
| `queries(obj)` | Shorthand for `and(...)` over multiple `query` entries. |
|
||||||
|
| `include(expr)` | Top-level wrapper marking `expr` as an inclusion rule. |
|
||||||
|
| `exclude(expr)` | Top-level wrapper marking `expr` as an exclusion rule. |
|
||||||
|
|
||||||
|
### `interpreter`
|
||||||
|
|
||||||
|
- **Type:** `(exprs, code?, id?, moduleType?, importerId?) => boolean`
|
||||||
|
|
||||||
|
Evaluates one or more top-level expressions against the given inputs. Returns `true` when at least one `include` matches and no `exclude` matches; when no `include` is present, defaults to `true` unless an `exclude` matches.
|
||||||
|
|
||||||
|
The argument required by each expression must be provided. For example, evaluating an `id(...)` expression without passing `id` will throw.
|
||||||
|
|
||||||
|
## `filterVitePlugins`
|
||||||
|
|
||||||
|
- **Type:** `<T>(plugins: T | T[] | null | undefined | false) => T[]`
|
||||||
|
|
||||||
|
Removes Vite plugins that target the dev server (`apply: 'serve'`) from a (possibly nested) plugin array. Plugins whose `apply` is a function are invoked with a `command: 'build'` context to decide. Useful when reusing a Vite plugin array inside a Rolldown config.
|
||||||
|
|
||||||
|
```ts
|
||||||
|
import { defineConfig } from 'rolldown'
|
||||||
|
import { filterVitePlugins } from '@rolldown/pluginutils'
|
||||||
|
import viteReact from '@vitejs/plugin-react'
|
||||||
|
|
||||||
|
export default defineConfig({
|
||||||
|
plugins: filterVitePlugins([
|
||||||
|
viteReact(),
|
||||||
|
{
|
||||||
|
name: 'dev-only',
|
||||||
|
apply: 'serve', // filtered out
|
||||||
|
// ...
|
||||||
|
},
|
||||||
|
]),
|
||||||
|
})
|
||||||
|
```
|
||||||
|
|
||||||
|
## License
|
||||||
|
|
||||||
|
MIT
|
||||||
+323
@@ -0,0 +1,323 @@
|
|||||||
|
//#region src/utils.ts
|
||||||
|
const postfixRE = /[?#].*$/;
|
||||||
|
function cleanUrl(url) {
|
||||||
|
return url.replace(postfixRE, "");
|
||||||
|
}
|
||||||
|
function extractQueryWithoutFragment(url) {
|
||||||
|
const questionMarkIndex = url.indexOf("?");
|
||||||
|
if (questionMarkIndex === -1) return "";
|
||||||
|
const fragmentIndex = url.indexOf("#", questionMarkIndex);
|
||||||
|
if (fragmentIndex === -1) return url.substring(questionMarkIndex);
|
||||||
|
else return url.substring(questionMarkIndex, fragmentIndex);
|
||||||
|
}
|
||||||
|
//#endregion
|
||||||
|
//#region src/filter/composable-filters.ts
|
||||||
|
var And = class {
|
||||||
|
kind;
|
||||||
|
args;
|
||||||
|
constructor(...args) {
|
||||||
|
if (args.length === 0) throw new Error("`And` expects at least one operand");
|
||||||
|
this.args = args;
|
||||||
|
this.kind = "and";
|
||||||
|
}
|
||||||
|
};
|
||||||
|
var Or = class {
|
||||||
|
kind;
|
||||||
|
args;
|
||||||
|
constructor(...args) {
|
||||||
|
if (args.length === 0) throw new Error("`Or` expects at least one operand");
|
||||||
|
this.args = args;
|
||||||
|
this.kind = "or";
|
||||||
|
}
|
||||||
|
};
|
||||||
|
var Not = class {
|
||||||
|
kind;
|
||||||
|
expr;
|
||||||
|
constructor(expr) {
|
||||||
|
this.expr = expr;
|
||||||
|
this.kind = "not";
|
||||||
|
}
|
||||||
|
};
|
||||||
|
var Id = class {
|
||||||
|
kind;
|
||||||
|
pattern;
|
||||||
|
params;
|
||||||
|
constructor(pattern, params) {
|
||||||
|
this.pattern = pattern;
|
||||||
|
this.kind = "id";
|
||||||
|
this.params = params ?? { cleanUrl: false };
|
||||||
|
}
|
||||||
|
};
|
||||||
|
var ImporterId = class {
|
||||||
|
kind;
|
||||||
|
pattern;
|
||||||
|
params;
|
||||||
|
constructor(pattern, params) {
|
||||||
|
this.pattern = pattern;
|
||||||
|
this.kind = "importerId";
|
||||||
|
this.params = params ?? { cleanUrl: false };
|
||||||
|
}
|
||||||
|
};
|
||||||
|
var ModuleType = class {
|
||||||
|
kind;
|
||||||
|
pattern;
|
||||||
|
constructor(pattern) {
|
||||||
|
this.pattern = pattern;
|
||||||
|
this.kind = "moduleType";
|
||||||
|
}
|
||||||
|
};
|
||||||
|
var Code = class {
|
||||||
|
kind;
|
||||||
|
pattern;
|
||||||
|
constructor(expr) {
|
||||||
|
this.pattern = expr;
|
||||||
|
this.kind = "code";
|
||||||
|
}
|
||||||
|
};
|
||||||
|
var Query = class {
|
||||||
|
kind;
|
||||||
|
key;
|
||||||
|
pattern;
|
||||||
|
constructor(key, pattern) {
|
||||||
|
this.pattern = pattern;
|
||||||
|
this.key = key;
|
||||||
|
this.kind = "query";
|
||||||
|
}
|
||||||
|
};
|
||||||
|
var Include = class {
|
||||||
|
kind;
|
||||||
|
expr;
|
||||||
|
constructor(expr) {
|
||||||
|
this.expr = expr;
|
||||||
|
this.kind = "include";
|
||||||
|
}
|
||||||
|
};
|
||||||
|
var Exclude = class {
|
||||||
|
kind;
|
||||||
|
expr;
|
||||||
|
constructor(expr) {
|
||||||
|
this.expr = expr;
|
||||||
|
this.kind = "exclude";
|
||||||
|
}
|
||||||
|
};
|
||||||
|
function and(...args) {
|
||||||
|
return new And(...args);
|
||||||
|
}
|
||||||
|
function or(...args) {
|
||||||
|
return new Or(...args);
|
||||||
|
}
|
||||||
|
function not(expr) {
|
||||||
|
return new Not(expr);
|
||||||
|
}
|
||||||
|
function id(pattern, params) {
|
||||||
|
return new Id(pattern, params);
|
||||||
|
}
|
||||||
|
function importerId(pattern, params) {
|
||||||
|
return new ImporterId(pattern, params);
|
||||||
|
}
|
||||||
|
function moduleType(pattern) {
|
||||||
|
return new ModuleType(pattern);
|
||||||
|
}
|
||||||
|
function code(pattern) {
|
||||||
|
return new Code(pattern);
|
||||||
|
}
|
||||||
|
function query(key, pattern) {
|
||||||
|
return new Query(key, pattern);
|
||||||
|
}
|
||||||
|
function include(expr) {
|
||||||
|
return new Include(expr);
|
||||||
|
}
|
||||||
|
function exclude(expr) {
|
||||||
|
return new Exclude(expr);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* convert a queryObject to FilterExpression like
|
||||||
|
* ```js
|
||||||
|
* and(query(k1, v1), query(k2, v2))
|
||||||
|
* ```
|
||||||
|
* @param queryFilterObject The query filter object needs to be matched.
|
||||||
|
* @returns a `And` FilterExpression
|
||||||
|
*/
|
||||||
|
function queries(queryFilter) {
|
||||||
|
return and(...Object.entries(queryFilter).map(([key, value]) => {
|
||||||
|
return new Query(key, value);
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
function interpreter(exprs, code, id, moduleType, importerId) {
|
||||||
|
let arr = [];
|
||||||
|
if (Array.isArray(exprs)) arr = exprs;
|
||||||
|
else arr = [exprs];
|
||||||
|
return interpreterImpl(arr, code, id, moduleType, importerId);
|
||||||
|
}
|
||||||
|
function interpreterImpl(expr, code, id, moduleType, importerId, ctx = {}) {
|
||||||
|
let hasInclude = false;
|
||||||
|
for (const e of expr) switch (e.kind) {
|
||||||
|
case "include":
|
||||||
|
hasInclude = true;
|
||||||
|
if (exprInterpreter(e.expr, code, id, moduleType, importerId, ctx)) return true;
|
||||||
|
break;
|
||||||
|
case "exclude":
|
||||||
|
if (exprInterpreter(e.expr, code, id, moduleType, importerId, ctx)) return false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return !hasInclude;
|
||||||
|
}
|
||||||
|
function exprInterpreter(expr, code, id, moduleType, importerId, ctx = {}) {
|
||||||
|
switch (expr.kind) {
|
||||||
|
case "and": return expr.args.every((e) => exprInterpreter(e, code, id, moduleType, importerId, ctx));
|
||||||
|
case "or": return expr.args.some((e) => exprInterpreter(e, code, id, moduleType, importerId, ctx));
|
||||||
|
case "not": return !exprInterpreter(expr.expr, code, id, moduleType, importerId, ctx);
|
||||||
|
case "id": {
|
||||||
|
if (id === void 0) throw new Error("`id` is required for `id` expression");
|
||||||
|
let idToMatch = id;
|
||||||
|
if (expr.params.cleanUrl) idToMatch = cleanUrl(idToMatch);
|
||||||
|
return typeof expr.pattern === "string" ? idToMatch === expr.pattern : expr.pattern.test(idToMatch);
|
||||||
|
}
|
||||||
|
case "importerId": {
|
||||||
|
if (importerId === void 0) return false;
|
||||||
|
let importerIdToMatch = importerId;
|
||||||
|
if (expr.params.cleanUrl) importerIdToMatch = cleanUrl(importerIdToMatch);
|
||||||
|
return typeof expr.pattern === "string" ? importerIdToMatch === expr.pattern : expr.pattern.test(importerIdToMatch);
|
||||||
|
}
|
||||||
|
case "moduleType":
|
||||||
|
if (moduleType === void 0) throw new Error("`moduleType` is required for `moduleType` expression");
|
||||||
|
return moduleType === expr.pattern;
|
||||||
|
case "code":
|
||||||
|
if (code === void 0) throw new Error("`code` is required for `code` expression");
|
||||||
|
return typeof expr.pattern === "string" ? code.includes(expr.pattern) : expr.pattern.test(code);
|
||||||
|
case "query": {
|
||||||
|
if (id === void 0) throw new Error("`id` is required for `Query` expression");
|
||||||
|
if (!ctx.urlSearchParamsCache) {
|
||||||
|
let queryString = extractQueryWithoutFragment(id);
|
||||||
|
ctx.urlSearchParamsCache = new URLSearchParams(queryString);
|
||||||
|
}
|
||||||
|
let urlParams = ctx.urlSearchParamsCache;
|
||||||
|
if (typeof expr.pattern === "boolean") if (expr.pattern) return urlParams.has(expr.key);
|
||||||
|
else return !urlParams.has(expr.key);
|
||||||
|
else if (typeof expr.pattern === "string") return urlParams.get(expr.key) === expr.pattern;
|
||||||
|
else return expr.pattern.test(urlParams.get(expr.key) ?? "");
|
||||||
|
}
|
||||||
|
default: throw new Error(`Expression ${JSON.stringify(expr)} is not expected.`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//#endregion
|
||||||
|
//#region src/filter/filter-vite-plugins.ts
|
||||||
|
/**
|
||||||
|
* Filters out Vite plugins that have `apply: 'serve'` set.
|
||||||
|
*
|
||||||
|
* Since Rolldown operates in build mode, plugins marked with `apply: 'serve'`
|
||||||
|
* are intended only for Vite's dev server and should be excluded from the build process.
|
||||||
|
*
|
||||||
|
* @param plugins - Array of plugins (can include nested arrays)
|
||||||
|
* @returns Filtered array with serve-only plugins removed
|
||||||
|
*
|
||||||
|
* @example
|
||||||
|
* ```ts
|
||||||
|
* import { defineConfig } from 'rolldown';
|
||||||
|
* import { filterVitePlugins } from '@rolldown/pluginutils';
|
||||||
|
* import viteReact from '@vitejs/plugin-react';
|
||||||
|
*
|
||||||
|
* export default defineConfig({
|
||||||
|
* plugins: filterVitePlugins([
|
||||||
|
* viteReact(),
|
||||||
|
* {
|
||||||
|
* name: 'dev-only',
|
||||||
|
* apply: 'serve', // This will be filtered out
|
||||||
|
* // ...
|
||||||
|
* }
|
||||||
|
* ])
|
||||||
|
* });
|
||||||
|
* ```
|
||||||
|
*/
|
||||||
|
function filterVitePlugins(plugins) {
|
||||||
|
if (!plugins) return [];
|
||||||
|
const pluginArray = Array.isArray(plugins) ? plugins : [plugins];
|
||||||
|
const result = [];
|
||||||
|
for (const plugin of pluginArray) {
|
||||||
|
if (!plugin) continue;
|
||||||
|
if (Array.isArray(plugin)) {
|
||||||
|
result.push(...filterVitePlugins(plugin));
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
const pluginWithApply = plugin;
|
||||||
|
if ("apply" in pluginWithApply) {
|
||||||
|
const applyValue = pluginWithApply.apply;
|
||||||
|
if (typeof applyValue === "function") try {
|
||||||
|
if (applyValue({}, {
|
||||||
|
command: "build",
|
||||||
|
mode: "production"
|
||||||
|
})) result.push(plugin);
|
||||||
|
} catch {
|
||||||
|
result.push(plugin);
|
||||||
|
}
|
||||||
|
else if (applyValue === "serve") continue;
|
||||||
|
else result.push(plugin);
|
||||||
|
} else result.push(plugin);
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
//#endregion
|
||||||
|
//#region src/filter/simple-filters.ts
|
||||||
|
/**
|
||||||
|
* Constructs a RegExp that matches the exact string specified.
|
||||||
|
*
|
||||||
|
* This is useful for plugin hook filters.
|
||||||
|
*
|
||||||
|
* @param str the string to match.
|
||||||
|
* @param flags flags for the RegExp.
|
||||||
|
*
|
||||||
|
* @example
|
||||||
|
* ```ts
|
||||||
|
* import { exactRegex } from '@rolldown/pluginutils';
|
||||||
|
* const plugin = {
|
||||||
|
* name: 'plugin',
|
||||||
|
* resolveId: {
|
||||||
|
* filter: { id: exactRegex('foo') },
|
||||||
|
* handler(id) {} // will only be called for `foo`
|
||||||
|
* }
|
||||||
|
* }
|
||||||
|
* ```
|
||||||
|
*/
|
||||||
|
function exactRegex(str, flags) {
|
||||||
|
return new RegExp(`^${escapeRegex(str)}$`, flags);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Constructs a RegExp that matches a value that has the specified prefix.
|
||||||
|
*
|
||||||
|
* This is useful for plugin hook filters.
|
||||||
|
*
|
||||||
|
* @param str the string to match.
|
||||||
|
* @param flags flags for the RegExp.
|
||||||
|
*
|
||||||
|
* @example
|
||||||
|
* ```ts
|
||||||
|
* import { prefixRegex } from '@rolldown/pluginutils';
|
||||||
|
* const plugin = {
|
||||||
|
* name: 'plugin',
|
||||||
|
* resolveId: {
|
||||||
|
* filter: { id: prefixRegex('foo') },
|
||||||
|
* handler(id) {} // will only be called for IDs starting with `foo`
|
||||||
|
* }
|
||||||
|
* }
|
||||||
|
* ```
|
||||||
|
*/
|
||||||
|
function prefixRegex(str, flags) {
|
||||||
|
return new RegExp(`^${escapeRegex(str)}`, flags);
|
||||||
|
}
|
||||||
|
const escapeRegexRE = /[-/\\^$*+?.()|[\]{}]/g;
|
||||||
|
function escapeRegex(str) {
|
||||||
|
return str.replace(escapeRegexRE, "\\$&");
|
||||||
|
}
|
||||||
|
function makeIdFiltersToMatchWithQuery(input) {
|
||||||
|
if (!Array.isArray(input)) return makeIdFilterToMatchWithQuery(input);
|
||||||
|
return input.map((i) => makeIdFilterToMatchWithQuery(i));
|
||||||
|
}
|
||||||
|
function makeIdFilterToMatchWithQuery(input) {
|
||||||
|
if (typeof input === "string") return `${input}{?*,}`;
|
||||||
|
return makeRegexIdFilterToMatchWithQuery(input);
|
||||||
|
}
|
||||||
|
function makeRegexIdFilterToMatchWithQuery(input) {
|
||||||
|
return new RegExp(input.source.replace(/(?<!\\)\$/g, "(?:\\?.*)?$"), input.flags);
|
||||||
|
}
|
||||||
|
//#endregion
|
||||||
|
export { queries as _, and as a, exprInterpreter as c, include as d, interpreter as f, or as g, not as h, filterVitePlugins as i, id as l, moduleType as m, makeIdFiltersToMatchWithQuery as n, code as o, interpreterImpl as p, prefixRegex as r, exclude as s, exactRegex as t, importerId as u, query as v };
|
||||||
+194
@@ -0,0 +1,194 @@
|
|||||||
|
//#region src/filter/composable-filters.d.ts
|
||||||
|
type StringOrRegExp = string | RegExp;
|
||||||
|
type PluginModuleType = 'js' | 'jsx' | 'ts' | 'tsx' | 'json' | 'text' | 'base64' | 'dataurl' | 'binary' | 'empty' | (string & {});
|
||||||
|
type FilterExpressionKind = FilterExpression['kind'];
|
||||||
|
type FilterExpression = And | Or | Not | Id | ImporterId | ModuleType | Code | Query;
|
||||||
|
type TopLevelFilterExpression = Include | Exclude;
|
||||||
|
declare class And {
|
||||||
|
kind: 'and';
|
||||||
|
args: FilterExpression[];
|
||||||
|
constructor(...args: FilterExpression[]);
|
||||||
|
}
|
||||||
|
declare class Or {
|
||||||
|
kind: 'or';
|
||||||
|
args: FilterExpression[];
|
||||||
|
constructor(...args: FilterExpression[]);
|
||||||
|
}
|
||||||
|
declare class Not {
|
||||||
|
kind: 'not';
|
||||||
|
expr: FilterExpression;
|
||||||
|
constructor(expr: FilterExpression);
|
||||||
|
}
|
||||||
|
interface QueryFilterObject {
|
||||||
|
[key: string]: StringOrRegExp | boolean;
|
||||||
|
}
|
||||||
|
interface IdParams {
|
||||||
|
cleanUrl?: boolean;
|
||||||
|
}
|
||||||
|
declare class Id {
|
||||||
|
kind: 'id';
|
||||||
|
pattern: StringOrRegExp;
|
||||||
|
params: IdParams;
|
||||||
|
constructor(pattern: StringOrRegExp, params?: IdParams);
|
||||||
|
}
|
||||||
|
declare class ImporterId {
|
||||||
|
kind: 'importerId';
|
||||||
|
pattern: StringOrRegExp;
|
||||||
|
params: IdParams;
|
||||||
|
constructor(pattern: StringOrRegExp, params?: IdParams);
|
||||||
|
}
|
||||||
|
declare class ModuleType {
|
||||||
|
kind: 'moduleType';
|
||||||
|
pattern: PluginModuleType;
|
||||||
|
constructor(pattern: PluginModuleType);
|
||||||
|
}
|
||||||
|
declare class Code {
|
||||||
|
kind: 'code';
|
||||||
|
pattern: StringOrRegExp;
|
||||||
|
constructor(expr: StringOrRegExp);
|
||||||
|
}
|
||||||
|
declare class Query {
|
||||||
|
kind: 'query';
|
||||||
|
key: string;
|
||||||
|
pattern: StringOrRegExp | boolean;
|
||||||
|
constructor(key: string, pattern: StringOrRegExp | boolean);
|
||||||
|
}
|
||||||
|
declare class Include {
|
||||||
|
kind: 'include';
|
||||||
|
expr: FilterExpression;
|
||||||
|
constructor(expr: FilterExpression);
|
||||||
|
}
|
||||||
|
declare class Exclude {
|
||||||
|
kind: 'exclude';
|
||||||
|
expr: FilterExpression;
|
||||||
|
constructor(expr: FilterExpression);
|
||||||
|
}
|
||||||
|
declare function and(...args: FilterExpression[]): And;
|
||||||
|
declare function or(...args: FilterExpression[]): Or;
|
||||||
|
declare function not(expr: FilterExpression): Not;
|
||||||
|
declare function id(pattern: StringOrRegExp, params?: IdParams): Id;
|
||||||
|
declare function importerId(pattern: StringOrRegExp, params?: IdParams): ImporterId;
|
||||||
|
declare function moduleType(pattern: PluginModuleType): ModuleType;
|
||||||
|
declare function code(pattern: StringOrRegExp): Code;
|
||||||
|
declare function query(key: string, pattern: StringOrRegExp | boolean): Query;
|
||||||
|
declare function include(expr: FilterExpression): Include;
|
||||||
|
declare function exclude(expr: FilterExpression): Exclude;
|
||||||
|
/**
|
||||||
|
* convert a queryObject to FilterExpression like
|
||||||
|
* ```js
|
||||||
|
* and(query(k1, v1), query(k2, v2))
|
||||||
|
* ```
|
||||||
|
* @param queryFilterObject The query filter object needs to be matched.
|
||||||
|
* @returns a `And` FilterExpression
|
||||||
|
*/
|
||||||
|
declare function queries(queryFilter: QueryFilterObject): And;
|
||||||
|
declare function interpreter(exprs: TopLevelFilterExpression | TopLevelFilterExpression[], code?: string, id?: string, moduleType?: PluginModuleType, importerId?: string): boolean;
|
||||||
|
interface InterpreterCtx {
|
||||||
|
urlSearchParamsCache?: URLSearchParams;
|
||||||
|
}
|
||||||
|
declare function interpreterImpl(expr: TopLevelFilterExpression[], code?: string, id?: string, moduleType?: PluginModuleType, importerId?: string, ctx?: InterpreterCtx): boolean;
|
||||||
|
declare function exprInterpreter(expr: FilterExpression, code?: string, id?: string, moduleType?: PluginModuleType, importerId?: string, ctx?: InterpreterCtx): boolean;
|
||||||
|
//#endregion
|
||||||
|
//#region src/filter/filter-vite-plugins.d.ts
|
||||||
|
/**
|
||||||
|
* Filters out Vite plugins that have `apply: 'serve'` set.
|
||||||
|
*
|
||||||
|
* Since Rolldown operates in build mode, plugins marked with `apply: 'serve'`
|
||||||
|
* are intended only for Vite's dev server and should be excluded from the build process.
|
||||||
|
*
|
||||||
|
* @param plugins - Array of plugins (can include nested arrays)
|
||||||
|
* @returns Filtered array with serve-only plugins removed
|
||||||
|
*
|
||||||
|
* @example
|
||||||
|
* ```ts
|
||||||
|
* import { defineConfig } from 'rolldown';
|
||||||
|
* import { filterVitePlugins } from '@rolldown/pluginutils';
|
||||||
|
* import viteReact from '@vitejs/plugin-react';
|
||||||
|
*
|
||||||
|
* export default defineConfig({
|
||||||
|
* plugins: filterVitePlugins([
|
||||||
|
* viteReact(),
|
||||||
|
* {
|
||||||
|
* name: 'dev-only',
|
||||||
|
* apply: 'serve', // This will be filtered out
|
||||||
|
* // ...
|
||||||
|
* }
|
||||||
|
* ])
|
||||||
|
* });
|
||||||
|
* ```
|
||||||
|
*/
|
||||||
|
declare function filterVitePlugins<T = any>(plugins: T | T[] | null | undefined | false): T[];
|
||||||
|
//#endregion
|
||||||
|
//#region src/filter/simple-filters.d.ts
|
||||||
|
/**
|
||||||
|
* Constructs a RegExp that matches the exact string specified.
|
||||||
|
*
|
||||||
|
* This is useful for plugin hook filters.
|
||||||
|
*
|
||||||
|
* @param str the string to match.
|
||||||
|
* @param flags flags for the RegExp.
|
||||||
|
*
|
||||||
|
* @example
|
||||||
|
* ```ts
|
||||||
|
* import { exactRegex } from '@rolldown/pluginutils';
|
||||||
|
* const plugin = {
|
||||||
|
* name: 'plugin',
|
||||||
|
* resolveId: {
|
||||||
|
* filter: { id: exactRegex('foo') },
|
||||||
|
* handler(id) {} // will only be called for `foo`
|
||||||
|
* }
|
||||||
|
* }
|
||||||
|
* ```
|
||||||
|
*/
|
||||||
|
declare function exactRegex(str: string, flags?: string): RegExp;
|
||||||
|
/**
|
||||||
|
* Constructs a RegExp that matches a value that has the specified prefix.
|
||||||
|
*
|
||||||
|
* This is useful for plugin hook filters.
|
||||||
|
*
|
||||||
|
* @param str the string to match.
|
||||||
|
* @param flags flags for the RegExp.
|
||||||
|
*
|
||||||
|
* @example
|
||||||
|
* ```ts
|
||||||
|
* import { prefixRegex } from '@rolldown/pluginutils';
|
||||||
|
* const plugin = {
|
||||||
|
* name: 'plugin',
|
||||||
|
* resolveId: {
|
||||||
|
* filter: { id: prefixRegex('foo') },
|
||||||
|
* handler(id) {} // will only be called for IDs starting with `foo`
|
||||||
|
* }
|
||||||
|
* }
|
||||||
|
* ```
|
||||||
|
*/
|
||||||
|
declare function prefixRegex(str: string, flags?: string): RegExp;
|
||||||
|
type WidenString<T> = T extends string ? string : T;
|
||||||
|
/**
|
||||||
|
* Converts a id filter to match with an id with a query.
|
||||||
|
*
|
||||||
|
* @param input the id filters to convert.
|
||||||
|
*
|
||||||
|
* @example
|
||||||
|
* ```ts
|
||||||
|
* import { makeIdFiltersToMatchWithQuery } from '@rolldown/pluginutils';
|
||||||
|
* const plugin = {
|
||||||
|
* name: 'plugin',
|
||||||
|
* transform: {
|
||||||
|
* filter: { id: makeIdFiltersToMatchWithQuery(['**' + '/*.js', /\.ts$/]) },
|
||||||
|
* // The handler will be called for IDs like:
|
||||||
|
* // - foo.js
|
||||||
|
* // - foo.js?foo
|
||||||
|
* // - foo.txt?foo.js
|
||||||
|
* // - foo.ts
|
||||||
|
* // - foo.ts?foo
|
||||||
|
* // - foo.txt?foo.ts
|
||||||
|
* handler(code, id) {}
|
||||||
|
* }
|
||||||
|
* }
|
||||||
|
* ```
|
||||||
|
*/
|
||||||
|
declare function makeIdFiltersToMatchWithQuery<T extends string | RegExp>(input: T): WidenString<T>;
|
||||||
|
declare function makeIdFiltersToMatchWithQuery<T extends string | RegExp>(input: readonly T[]): WidenString<T>[];
|
||||||
|
declare function makeIdFiltersToMatchWithQuery(input: string | RegExp | readonly (string | RegExp)[]): string | RegExp | (string | RegExp)[];
|
||||||
|
//#endregion
|
||||||
|
export { FilterExpression, FilterExpressionKind, QueryFilterObject, TopLevelFilterExpression, and, code, exactRegex, exclude, exprInterpreter, filterVitePlugins, id, importerId, include, interpreter, interpreterImpl, makeIdFiltersToMatchWithQuery, moduleType, not, or, prefixRegex, queries, query };
|
||||||
+2
@@ -0,0 +1,2 @@
|
|||||||
|
import { _ as queries, a as and, c as exprInterpreter, d as include, f as interpreter, g as or, h as not, i as filterVitePlugins, l as id, m as moduleType, n as makeIdFiltersToMatchWithQuery, o as code, p as interpreterImpl, r as prefixRegex, s as exclude, t as exactRegex, u as importerId, v as query } from "../filter-B_mD-HGz.mjs";
|
||||||
|
export { and, code, exactRegex, exclude, exprInterpreter, filterVitePlugins, id, importerId, include, interpreter, interpreterImpl, makeIdFiltersToMatchWithQuery, moduleType, not, or, prefixRegex, queries, query };
|
||||||
+2
@@ -0,0 +1,2 @@
|
|||||||
|
import { FilterExpression, FilterExpressionKind, QueryFilterObject, TopLevelFilterExpression, and, code, exactRegex, exclude, exprInterpreter, filterVitePlugins, id, importerId, include, interpreter, interpreterImpl, makeIdFiltersToMatchWithQuery, moduleType, not, or, prefixRegex, queries, query } from "./filter/index.mjs";
|
||||||
|
export { FilterExpression, FilterExpressionKind, QueryFilterObject, TopLevelFilterExpression, and, code, exactRegex, exclude, exprInterpreter, filterVitePlugins, id, importerId, include, interpreter, interpreterImpl, makeIdFiltersToMatchWithQuery, moduleType, not, or, prefixRegex, queries, query };
|
||||||
+2
@@ -0,0 +1,2 @@
|
|||||||
|
import { _ as queries, a as and, c as exprInterpreter, d as include, f as interpreter, g as or, h as not, i as filterVitePlugins, l as id, m as moduleType, n as makeIdFiltersToMatchWithQuery, o as code, p as interpreterImpl, r as prefixRegex, s as exclude, t as exactRegex, u as importerId, v as query } from "./filter-B_mD-HGz.mjs";
|
||||||
|
export { and, code, exactRegex, exclude, exprInterpreter, filterVitePlugins, id, importerId, include, interpreter, interpreterImpl, makeIdFiltersToMatchWithQuery, moduleType, not, or, prefixRegex, queries, query };
|
||||||
+40
@@ -0,0 +1,40 @@
|
|||||||
|
{
|
||||||
|
"name": "@rolldown/pluginutils",
|
||||||
|
"version": "1.0.1",
|
||||||
|
"description": "Plugin utilities for Rolldown",
|
||||||
|
"keywords": [
|
||||||
|
"filter",
|
||||||
|
"plugin",
|
||||||
|
"rolldown"
|
||||||
|
],
|
||||||
|
"homepage": "https://github.com/rolldown/plugins/tree/main/packages/pluginutils#readme",
|
||||||
|
"bugs": {
|
||||||
|
"url": "https://github.com/rolldown/plugins/issues"
|
||||||
|
},
|
||||||
|
"license": "MIT",
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "git+https://github.com/rolldown/plugins.git",
|
||||||
|
"directory": "packages/pluginutils"
|
||||||
|
},
|
||||||
|
"files": [
|
||||||
|
"dist"
|
||||||
|
],
|
||||||
|
"type": "module",
|
||||||
|
"exports": {
|
||||||
|
".": "./dist/index.mjs",
|
||||||
|
"./filter": "./dist/filter/index.mjs",
|
||||||
|
"./package.json": "./package.json"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"@types/picomatch": "^4.0.3",
|
||||||
|
"picomatch": "^4.0.4",
|
||||||
|
"typescript": "^5.9.3"
|
||||||
|
},
|
||||||
|
"scripts": {
|
||||||
|
"dev": "tsdown --watch",
|
||||||
|
"build": "tsdown",
|
||||||
|
"test": "vitest --project pluginutils",
|
||||||
|
"test:types": "vitest --project pluginutils --typecheck.only"
|
||||||
|
}
|
||||||
|
}
|
||||||
+21
@@ -0,0 +1,21 @@
|
|||||||
|
MIT License
|
||||||
|
|
||||||
|
Copyright (c) 2019-present, Yuxi (Evan) You and Vite contributors
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
||||||
+204
@@ -0,0 +1,204 @@
|
|||||||
|
# @vitejs/plugin-react [](https://npmjs.com/package/@vitejs/plugin-react)
|
||||||
|
|
||||||
|
The default Vite plugin for React projects.
|
||||||
|
|
||||||
|
- enable [Fast Refresh](https://www.npmjs.com/package/react-refresh) in development (requires react >= 16.9)
|
||||||
|
- use the [automatic JSX runtime](https://legacy.reactjs.org/blog/2020/09/22/introducing-the-new-jsx-transform.html)
|
||||||
|
- small installation size
|
||||||
|
|
||||||
|
```js
|
||||||
|
// vite.config.js
|
||||||
|
import { defineConfig } from 'vite'
|
||||||
|
import react from '@vitejs/plugin-react'
|
||||||
|
|
||||||
|
export default defineConfig({
|
||||||
|
plugins: [react()],
|
||||||
|
})
|
||||||
|
```
|
||||||
|
|
||||||
|
## Options
|
||||||
|
|
||||||
|
### include
|
||||||
|
|
||||||
|
Includes `.js`, `.jsx`, `.ts` & `.tsx` by default. This option can be used to add fast refresh to `.mdx` files:
|
||||||
|
|
||||||
|
```js
|
||||||
|
import { defineConfig } from 'vite'
|
||||||
|
import react from '@vitejs/plugin-react'
|
||||||
|
import mdx from '@mdx-js/rollup'
|
||||||
|
|
||||||
|
export default defineConfig({
|
||||||
|
plugins: [
|
||||||
|
{ enforce: 'pre', ...mdx() },
|
||||||
|
react({ include: /\.(mdx|js|jsx|ts|tsx)$/ }),
|
||||||
|
],
|
||||||
|
})
|
||||||
|
```
|
||||||
|
|
||||||
|
### exclude
|
||||||
|
|
||||||
|
The default value is `/node_modules/`. You may use it to exclude JSX/TSX files that runs in a worker or are not React files.
|
||||||
|
Except if explicitly desired, you should keep `node_modules` in the exclude list:
|
||||||
|
|
||||||
|
```js
|
||||||
|
import { defineConfig } from 'vite'
|
||||||
|
import react from '@vitejs/plugin-react'
|
||||||
|
|
||||||
|
export default defineConfig({
|
||||||
|
plugins: [
|
||||||
|
react({ exclude: [/\/pdf\//, /\.solid\.tsx$/, /\/node_modules\//] }),
|
||||||
|
],
|
||||||
|
})
|
||||||
|
```
|
||||||
|
|
||||||
|
### jsxImportSource
|
||||||
|
|
||||||
|
Control where the JSX factory is imported from. By default, this is inferred from `jsxImportSource` from corresponding a tsconfig file for a transformed file.
|
||||||
|
|
||||||
|
```js
|
||||||
|
react({ jsxImportSource: '@emotion/react' })
|
||||||
|
```
|
||||||
|
|
||||||
|
### jsxRuntime
|
||||||
|
|
||||||
|
By default, the plugin uses the [automatic JSX runtime](https://legacy.reactjs.org/blog/2020/09/22/introducing-the-new-jsx-transform.html). However, if you encounter any issues, you may opt out using the `jsxRuntime` option.
|
||||||
|
|
||||||
|
```js
|
||||||
|
react({ jsxRuntime: 'classic' })
|
||||||
|
```
|
||||||
|
|
||||||
|
### reactRefreshHost
|
||||||
|
|
||||||
|
The `reactRefreshHost` option is only necessary in a module federation context. It enables HMR to work between a remote & host application. In your remote Vite config, you would add your host origin:
|
||||||
|
|
||||||
|
```js
|
||||||
|
react({ reactRefreshHost: 'http://localhost:3000' })
|
||||||
|
```
|
||||||
|
|
||||||
|
Under the hood, this simply updates the React Fash Refresh runtime URL from `/@react-refresh` to `http://localhost:3000/@react-refresh` to ensure there is only one Refresh runtime across the whole application. Note that if you define `base` option in the host application, you need to include it in the option, like: `http://localhost:3000/{base}`.
|
||||||
|
|
||||||
|
## React Compiler
|
||||||
|
|
||||||
|
### Rust React Compiler
|
||||||
|
|
||||||
|
> [!WARNING]
|
||||||
|
> Native React Compiler support is experimental.
|
||||||
|
|
||||||
|
The `compiler` option uses [`oxc-transform-react`](https://npmx.dev/package/oxc-transform-react), a Rust port of [React Compiler](https://react.dev/learn/react-compiler), which must be installed as an optional peer dependency:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
npm install -D oxc-transform-react
|
||||||
|
```
|
||||||
|
|
||||||
|
```js
|
||||||
|
// vite.config.js
|
||||||
|
import { defineConfig } from 'vite'
|
||||||
|
import react from '@vitejs/plugin-react'
|
||||||
|
|
||||||
|
export default defineConfig({
|
||||||
|
plugins: [react({ compiler: true })],
|
||||||
|
})
|
||||||
|
```
|
||||||
|
|
||||||
|
The `compiler` option also accepts [React Compiler options](https://react.dev/reference/react-compiler/configuration):
|
||||||
|
|
||||||
|
```js
|
||||||
|
react({ compiler: { compilationMode: 'annotation' } })
|
||||||
|
```
|
||||||
|
|
||||||
|
Set `logDiagnostics` to `true` to log recoverable React Compiler diagnostics through Vite. This option defaults to `false`. Fatal diagnostics are always logged and fail the transform.
|
||||||
|
|
||||||
|
```js
|
||||||
|
react({ compiler: { logDiagnostics: true } })
|
||||||
|
```
|
||||||
|
|
||||||
|
### Babel React Compiler
|
||||||
|
|
||||||
|
React Compiler can also be used through Babel with the exported `reactCompilerPreset` helper. This requires [`@rolldown/plugin-babel`](https://npmx.dev/package/@rolldown/plugin-babel), [`babel-plugin-react-compiler`](https://npmx.dev/package/babel-plugin-react-compiler), and [`@babel/core`](https://npmx.dev/package/@babel/core) as peer dependencies:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
npm install -D @rolldown/plugin-babel @babel/core babel-plugin-react-compiler
|
||||||
|
```
|
||||||
|
|
||||||
|
If you are using TypeScript with Babel 7, you will also need to install [`@types/babel__core`](https://npmx.dev/package/@types/babel__core):
|
||||||
|
|
||||||
|
```sh
|
||||||
|
npm install -D @types/babel__core
|
||||||
|
```
|
||||||
|
|
||||||
|
```js
|
||||||
|
// vite.config.js
|
||||||
|
import { defineConfig } from 'vite'
|
||||||
|
import react, { reactCompilerPreset } from '@vitejs/plugin-react'
|
||||||
|
import babel from '@rolldown/plugin-babel'
|
||||||
|
|
||||||
|
export default defineConfig({
|
||||||
|
plugins: [react(), babel({ presets: [reactCompilerPreset()] })],
|
||||||
|
})
|
||||||
|
```
|
||||||
|
|
||||||
|
The `reactCompilerPreset` accepts an optional options object with the following properties:
|
||||||
|
|
||||||
|
- `compilationMode` — Set to `'annotation'` to only compile components annotated with `"use memo"`.
|
||||||
|
- `target` — Set to `'17'` or `'18'` to target older React versions (uses `react-compiler-runtime` instead of `react/compiler-runtime`).
|
||||||
|
|
||||||
|
Additional options can be found in the [documentation](https://react.dev/reference/react-compiler/configuration).
|
||||||
|
|
||||||
|
```js
|
||||||
|
babel({
|
||||||
|
presets: [reactCompilerPreset({ compilationMode: 'annotation' })],
|
||||||
|
})
|
||||||
|
```
|
||||||
|
|
||||||
|
> [!TIP]
|
||||||
|
>
|
||||||
|
> `reactCompilerPreset` is only a convenient helper with a preconfigured filter. You can configure override the filters to fit your project structure or code. For example, if you know a large portion of your files are never React/hook-related or won't benefit from the React Compiler, you can aggressively exclude them via `rolldown.filter`:
|
||||||
|
>
|
||||||
|
> ```js
|
||||||
|
> const myPreset = reactCompilerPreset()
|
||||||
|
> myPreset.rolldown.filter.id.exclude = ['src/legacy/**', 'src/utils/**']
|
||||||
|
>
|
||||||
|
> babel({
|
||||||
|
> presets: [myPreset],
|
||||||
|
> })
|
||||||
|
> ```
|
||||||
|
|
||||||
|
## `@vitejs/plugin-react/preamble`
|
||||||
|
|
||||||
|
The package provides `@vitejs/plugin-react/preamble` to initialize HMR runtime from client entrypoint for SSR applications which don't use [`transformIndexHtml` API](https://vite.dev/guide/api-javascript.html#vitedevserver). For example:
|
||||||
|
|
||||||
|
```js
|
||||||
|
// [entry.client.js]
|
||||||
|
import '@vitejs/plugin-react/preamble'
|
||||||
|
```
|
||||||
|
|
||||||
|
Alternatively, you can manually call `transformIndexHtml` during SSR, which sets up equivalent initialization code. Here's an example for an Express server:
|
||||||
|
|
||||||
|
```js
|
||||||
|
app.get('/', async (req, res, next) => {
|
||||||
|
try {
|
||||||
|
let html = fs.readFileSync(path.resolve(root, 'index.html'), 'utf-8')
|
||||||
|
|
||||||
|
// Transform HTML using Vite plugins.
|
||||||
|
html = await viteServer.transformIndexHtml(req.url, html)
|
||||||
|
|
||||||
|
res.send(html)
|
||||||
|
} catch (e) {
|
||||||
|
return next(e)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
```
|
||||||
|
|
||||||
|
Otherwise, you'll get the following error:
|
||||||
|
|
||||||
|
```
|
||||||
|
Uncaught Error: @vitejs/plugin-react can't detect preamble. Something is wrong.
|
||||||
|
```
|
||||||
|
|
||||||
|
## Consistent components exports
|
||||||
|
|
||||||
|
For React refresh to work correctly, your file should only export React components. You can find a good explanation in the [Gatsby docs](https://www.gatsbyjs.com/docs/reference/local-development/fast-refresh/#how-it-works).
|
||||||
|
|
||||||
|
If an incompatible change in exports is found, the module will be invalidated and HMR will propagate. To make it easier to export simple constants alongside your component, the module is only invalidated when their value changes.
|
||||||
|
|
||||||
|
You can catch mistakes and get more detailed warnings with this [ESLint rule](https://github.com/ArnaudBarre/eslint-plugin-react-refresh), this [Oxlint rule](https://oxc.rs/docs/guide/usage/linter/rules/react/only-export-components.html), or this [Biome rule](https://biomejs.dev/linter/rules/use-component-export-only-modules).
|
||||||
+63
@@ -0,0 +1,63 @@
|
|||||||
|
import { Plugin } from "vite";
|
||||||
|
import { ReactCompilerBabelPluginOptions, ReactCompilerOptions, RolldownBabelPreset } from "#optionalTypes";
|
||||||
|
//#region src/reactCompilerPreset.d.ts
|
||||||
|
export declare const reactCompilerPreset: (options?: ReactCompilerBabelPluginOptions) => RolldownBabelPreset;
|
||||||
|
//#endregion
|
||||||
|
//#region src/index.d.ts
|
||||||
|
interface ReactCompilerPluginOptions extends ReactCompilerOptions {
|
||||||
|
/**
|
||||||
|
* Log recoverable React Compiler diagnostics through Vite.
|
||||||
|
* Fatal diagnostics are always logged and fail the transform.
|
||||||
|
* @default false
|
||||||
|
* @deprecated Use `reportDiagnostics` instead
|
||||||
|
*/
|
||||||
|
logDiagnostics?: boolean;
|
||||||
|
}
|
||||||
|
export interface Options {
|
||||||
|
/**
|
||||||
|
* Can be used to process extra files like `.mdx`
|
||||||
|
* @example include: /\.(mdx|js|jsx|ts|tsx)$/
|
||||||
|
* @default /\.[tj]sx?$/
|
||||||
|
*/
|
||||||
|
include?: string | RegExp | Array<string | RegExp>;
|
||||||
|
/**
|
||||||
|
* Can be used to exclude JSX/TSX files that runs in a worker or are not React files.
|
||||||
|
* Except if explicitly desired, you should keep node_modules in the exclude list
|
||||||
|
* @example exclude: [/\/pdf\//, /\.solid\.tsx$/, /\/node_modules\//]
|
||||||
|
* @default /\/node_modules\//
|
||||||
|
*/
|
||||||
|
exclude?: string | RegExp | Array<string | RegExp>;
|
||||||
|
/**
|
||||||
|
* Control where the JSX factory is imported from.
|
||||||
|
* https://oxc.rs/docs/guide/usage/transformer/jsx.html#import-source
|
||||||
|
* @default 'react'
|
||||||
|
*/
|
||||||
|
jsxImportSource?: string;
|
||||||
|
/**
|
||||||
|
* Note: Skipping React import with classic runtime is not supported from v4
|
||||||
|
* @default "automatic"
|
||||||
|
*/
|
||||||
|
jsxRuntime?: 'classic' | 'automatic';
|
||||||
|
/**
|
||||||
|
* React Fast Refresh runtime URL prefix.
|
||||||
|
* Useful in a module federation context to enable HMR by specifying
|
||||||
|
* the host application URL in the Vite config of a remote application.
|
||||||
|
* @example
|
||||||
|
* reactRefreshHost: 'http://localhost:3000'
|
||||||
|
*/
|
||||||
|
reactRefreshHost?: string;
|
||||||
|
/**
|
||||||
|
* Enable React Compiler with its default options or configure it.
|
||||||
|
* This requires `oxc-transform-react` to be installed.
|
||||||
|
* @default false
|
||||||
|
* @experimental
|
||||||
|
*/
|
||||||
|
compiler?: boolean | ReactCompilerPluginOptions;
|
||||||
|
}
|
||||||
|
declare function viteReact(opts?: Options): Plugin[];
|
||||||
|
declare namespace viteReact {
|
||||||
|
var preambleCode: string;
|
||||||
|
}
|
||||||
|
declare function viteReactForCjs(this: unknown, options: Options): Plugin[];
|
||||||
|
//#endregion
|
||||||
|
export { type ReactCompilerPluginOptions as ReactCompilerOptions, viteReact as default, viteReactForCjs as "module.exports" };
|
||||||
+267
@@ -0,0 +1,267 @@
|
|||||||
|
import { readFileSync } from "node:fs";
|
||||||
|
import { dirname, join } from "node:path";
|
||||||
|
import { fileURLToPath } from "node:url";
|
||||||
|
import { exactRegex, makeIdFiltersToMatchWithQuery } from "@rolldown/pluginutils";
|
||||||
|
import { reactRefreshWrapperPlugin } from "vite/internal";
|
||||||
|
//#region ../common/refresh-utils.ts
|
||||||
|
const runtimePublicPath = "/@react-refresh";
|
||||||
|
const preambleCode = `import { injectIntoGlobalHook } from "__BASE__${runtimePublicPath.slice(1)}";
|
||||||
|
injectIntoGlobalHook(window);
|
||||||
|
window.$RefreshReg$ = () => {};
|
||||||
|
window.$RefreshSig$ = () => (type) => type;`;
|
||||||
|
const getPreambleCode = (base) => preambleCode.replace("__BASE__", base);
|
||||||
|
function virtualPreamblePlugin({ name, isEnabled }) {
|
||||||
|
return {
|
||||||
|
name: "vite:react-virtual-preamble",
|
||||||
|
resolveId: {
|
||||||
|
order: "pre",
|
||||||
|
filter: { id: exactRegex(name) },
|
||||||
|
handler(source) {
|
||||||
|
if (source === name) return "\0" + source;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
load: {
|
||||||
|
filter: { id: exactRegex("\0" + name) },
|
||||||
|
handler(id) {
|
||||||
|
if (id === "\0" + name) {
|
||||||
|
if (isEnabled()) return preambleCode.replace("__BASE__", "/");
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
//#endregion
|
||||||
|
//#region ../common/warning.ts
|
||||||
|
const silenceUseClientWarning = (userConfig) => ({ rollupOptions: { onwarn(warning, defaultHandler) {
|
||||||
|
if (warning.code === "MODULE_LEVEL_DIRECTIVE" && (warning.message.includes("use client") || warning.message.includes("use server"))) return;
|
||||||
|
if (warning.code === "SOURCEMAP_ERROR" && warning.message.includes("resolve original location") && warning.pos === 0) return;
|
||||||
|
if (userConfig.build?.rollupOptions?.onwarn) userConfig.build.rollupOptions.onwarn(warning, defaultHandler);
|
||||||
|
else defaultHandler(warning);
|
||||||
|
} } });
|
||||||
|
//#endregion
|
||||||
|
//#region src/reactCompilerPreset.ts
|
||||||
|
const defaultCodeFilter = /forwardRef|memo|\b(?:[A-Z]|use[A-Z0-9])/;
|
||||||
|
const reactCompilerPreset = (options = {}) => ({
|
||||||
|
preset: () => ({ plugins: [[fileURLToPath(import.meta.resolve("babel-plugin-react-compiler")), options]] }),
|
||||||
|
rolldown: {
|
||||||
|
filter: { code: options.compilationMode === "annotation" ? /['"]use memo['"]/ : defaultCodeFilter },
|
||||||
|
applyToEnvironmentHook: (env) => env.config.consumer === "client",
|
||||||
|
optimizeDeps: { include: options.target === "17" || options.target === "18" ? ["react-compiler-runtime"] : ["react/compiler-runtime"] }
|
||||||
|
}
|
||||||
|
});
|
||||||
|
//#endregion
|
||||||
|
//#region src/index.ts
|
||||||
|
const _dirname = dirname(fileURLToPath(import.meta.url));
|
||||||
|
const refreshRuntimePath = join(_dirname, "refresh-runtime.js");
|
||||||
|
const defaultIncludeRE = /\.[tj]sx?$/;
|
||||||
|
const defaultExcludeRE = /\/node_modules\//;
|
||||||
|
function viteReact(opts = {}) {
|
||||||
|
const include = opts.include ?? defaultIncludeRE;
|
||||||
|
const exclude = opts.exclude ?? defaultExcludeRE;
|
||||||
|
const jsxImportSource = opts.jsxImportSource ?? "react";
|
||||||
|
const jsxImportRuntime = `${jsxImportSource}/jsx-runtime`;
|
||||||
|
const jsxImportDevRuntime = `${jsxImportSource}/jsx-dev-runtime`;
|
||||||
|
let runningInVite = false;
|
||||||
|
let skipFastRefresh = true;
|
||||||
|
let base;
|
||||||
|
let isBundledDev = false;
|
||||||
|
function calculateSkipFastRefresh(isProduction, command, hmr) {
|
||||||
|
return isProduction || command === "build" || hmr === false;
|
||||||
|
}
|
||||||
|
const viteBabel = {
|
||||||
|
name: "vite:react-babel",
|
||||||
|
enforce: "pre",
|
||||||
|
config(_userConfig, { command }) {
|
||||||
|
const refresh = command === "serve" && !opts.compiler;
|
||||||
|
if (opts.jsxRuntime === "classic") return { oxc: {
|
||||||
|
jsx: {
|
||||||
|
runtime: "classic",
|
||||||
|
refresh
|
||||||
|
},
|
||||||
|
jsxRefreshInclude: makeIdFiltersToMatchWithQuery(include),
|
||||||
|
jsxRefreshExclude: makeIdFiltersToMatchWithQuery(exclude)
|
||||||
|
} };
|
||||||
|
else return {
|
||||||
|
oxc: {
|
||||||
|
jsx: {
|
||||||
|
runtime: "automatic",
|
||||||
|
importSource: opts.jsxImportSource,
|
||||||
|
refresh
|
||||||
|
},
|
||||||
|
jsxRefreshInclude: makeIdFiltersToMatchWithQuery(include),
|
||||||
|
jsxRefreshExclude: makeIdFiltersToMatchWithQuery(exclude)
|
||||||
|
},
|
||||||
|
optimizeDeps: { rolldownOptions: { transform: { jsx: { runtime: "automatic" } } } }
|
||||||
|
};
|
||||||
|
},
|
||||||
|
configResolved(config) {
|
||||||
|
runningInVite = true;
|
||||||
|
base = config.base;
|
||||||
|
if (config.experimental.bundledDev) isBundledDev = true;
|
||||||
|
if (skipFastRefresh !== calculateSkipFastRefresh(config.isProduction, config.command, config.server?.hmr)) this.warn(`NODE_ENV (${JSON.stringify(process.env.NODE_ENV)}) or server.hmr was changed by plugins after the react plugin read the config. This may cause unexpected behavior.`);
|
||||||
|
},
|
||||||
|
options(options) {
|
||||||
|
if (!runningInVite) {
|
||||||
|
options.transform ??= {};
|
||||||
|
options.transform.jsx = {
|
||||||
|
runtime: opts.jsxRuntime,
|
||||||
|
importSource: opts.jsxImportSource
|
||||||
|
};
|
||||||
|
return options;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
const viteRefreshWrapper = {
|
||||||
|
name: "vite:react:refresh-wrapper",
|
||||||
|
apply: "serve",
|
||||||
|
async applyToEnvironment(env) {
|
||||||
|
if (env.config.consumer !== "client" || skipFastRefresh) return false;
|
||||||
|
return reactRefreshWrapperPlugin({
|
||||||
|
cwd: process.cwd(),
|
||||||
|
include: makeIdFiltersToMatchWithQuery(include),
|
||||||
|
exclude: makeIdFiltersToMatchWithQuery(exclude),
|
||||||
|
jsxImportSource,
|
||||||
|
reactRefreshHost: opts.reactRefreshHost ?? ""
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
const viteConfigPost = {
|
||||||
|
name: "vite:react:config-post",
|
||||||
|
enforce: "post",
|
||||||
|
config(userConfig, { command }) {
|
||||||
|
skipFastRefresh = calculateSkipFastRefresh(process.env.NODE_ENV === "production", command, userConfig.server?.hmr);
|
||||||
|
if (skipFastRefresh) return { oxc: { jsx: { refresh: false } } };
|
||||||
|
}
|
||||||
|
};
|
||||||
|
const viteReactRefreshBundledDevMode = {
|
||||||
|
name: "vite:react-refresh-fbm",
|
||||||
|
enforce: "pre",
|
||||||
|
transformIndexHtml: {
|
||||||
|
handler() {
|
||||||
|
if (!skipFastRefresh && isBundledDev) return [{
|
||||||
|
tag: "script",
|
||||||
|
attrs: { type: "module" },
|
||||||
|
children: getPreambleCode("/")
|
||||||
|
}];
|
||||||
|
},
|
||||||
|
order: "pre"
|
||||||
|
}
|
||||||
|
};
|
||||||
|
const dependencies = [
|
||||||
|
"react",
|
||||||
|
"react-dom",
|
||||||
|
jsxImportDevRuntime,
|
||||||
|
jsxImportRuntime
|
||||||
|
];
|
||||||
|
const plugins = [
|
||||||
|
viteBabel,
|
||||||
|
viteRefreshWrapper,
|
||||||
|
viteConfigPost,
|
||||||
|
viteReactRefreshBundledDevMode,
|
||||||
|
{
|
||||||
|
name: "vite:react-refresh",
|
||||||
|
enforce: "pre",
|
||||||
|
config: (userConfig) => ({
|
||||||
|
build: silenceUseClientWarning(userConfig),
|
||||||
|
optimizeDeps: { include: dependencies }
|
||||||
|
}),
|
||||||
|
resolveId: {
|
||||||
|
filter: { id: exactRegex(runtimePublicPath) },
|
||||||
|
handler(id) {
|
||||||
|
if (id === "/@react-refresh") return id;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
load: {
|
||||||
|
filter: { id: exactRegex(runtimePublicPath) },
|
||||||
|
handler(id) {
|
||||||
|
if (id === "/@react-refresh") return readFileSync(refreshRuntimePath, "utf-8").replace(/__README_URL__/g, "https://github.com/vitejs/vite-plugin-react/tree/main/packages/plugin-react");
|
||||||
|
}
|
||||||
|
},
|
||||||
|
transformIndexHtml() {
|
||||||
|
if (!skipFastRefresh && !isBundledDev) return [{
|
||||||
|
tag: "script",
|
||||||
|
attrs: { type: "module" },
|
||||||
|
children: getPreambleCode(base)
|
||||||
|
}];
|
||||||
|
}
|
||||||
|
},
|
||||||
|
virtualPreamblePlugin({
|
||||||
|
name: "@vitejs/plugin-react/preamble",
|
||||||
|
isEnabled: () => !skipFastRefresh && !isBundledDev
|
||||||
|
})
|
||||||
|
];
|
||||||
|
if (opts.compiler) plugins.unshift(createReactCompilerPlugin(opts.compiler === true ? {} : opts.compiler, include, exclude, opts, () => !skipFastRefresh));
|
||||||
|
return plugins;
|
||||||
|
}
|
||||||
|
function createReactCompilerPlugin({ logDiagnostics, ...reactCompilerOptions }, include, exclude, reactOptions, isFastRefreshEnabled) {
|
||||||
|
let jsxDevelopment = false;
|
||||||
|
let compiler;
|
||||||
|
const runtime = reactCompilerOptions.target === "17" || reactCompilerOptions.target === "18" ? "react-compiler-runtime" : "react/compiler-runtime";
|
||||||
|
const jsxImportSource = reactOptions.jsxImportSource ?? "react";
|
||||||
|
const jsxImportRuntime = `${jsxImportSource}/jsx-runtime`;
|
||||||
|
const jsxImportDevRuntime = `${jsxImportSource}/jsx-dev-runtime`;
|
||||||
|
const loadCompiler = async (onError) => {
|
||||||
|
if (compiler) return compiler;
|
||||||
|
try {
|
||||||
|
return compiler = await import("oxc-transform-react");
|
||||||
|
} catch (error) {
|
||||||
|
return onError(`React Compiler requires the optional \`oxc-transform-react\` package. Install it in your project before enabling \`react({ compiler: true })\`.${error instanceof Error ? `\n${error.message}` : ""}`);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
return {
|
||||||
|
name: "vite:react-compiler",
|
||||||
|
enforce: "pre",
|
||||||
|
async config() {
|
||||||
|
await loadCompiler((message) => this.error(message));
|
||||||
|
return { optimizeDeps: { include: [runtime] } };
|
||||||
|
},
|
||||||
|
configResolved(config) {
|
||||||
|
jsxDevelopment = !config.isProduction;
|
||||||
|
},
|
||||||
|
transform: {
|
||||||
|
filter: { id: {
|
||||||
|
include: makeIdFiltersToMatchWithQuery(include),
|
||||||
|
exclude: makeIdFiltersToMatchWithQuery(exclude)
|
||||||
|
} },
|
||||||
|
async handler(code, id) {
|
||||||
|
const [filepath] = id.split("?");
|
||||||
|
const isJSX = filepath.endsWith("x");
|
||||||
|
const isClient = this.environment?.config.consumer !== "server";
|
||||||
|
const refreshEnabled = isClient && isFastRefreshEnabled() && (isJSX || code.includes(jsxImportRuntime) || code.includes(jsxImportDevRuntime));
|
||||||
|
const shouldCompile = isClient && (reactCompilerOptions.compilationMode === "annotation" ? /['"]use memo['"]/.test(code) : defaultCodeFilter.test(code));
|
||||||
|
const { transform } = compiler ?? await loadCompiler((message) => this.error(message));
|
||||||
|
const result = await transform(id.split("?")[0], code, {
|
||||||
|
jsx: {
|
||||||
|
runtime: reactOptions.jsxRuntime,
|
||||||
|
development: jsxDevelopment,
|
||||||
|
importSource: reactOptions.jsxImportSource,
|
||||||
|
refresh: refreshEnabled
|
||||||
|
},
|
||||||
|
reactCompiler: !shouldCompile ? false : logDiagnostics ? {
|
||||||
|
...reactCompilerOptions,
|
||||||
|
reportDiagnostics: true
|
||||||
|
} : reactCompilerOptions,
|
||||||
|
sourcemap: this.environment ? this.environment.config.command !== "build" || !!this.environment.config.build.sourcemap : true
|
||||||
|
});
|
||||||
|
const diagnostics = result.errors.map((error) => `${error.message}${error.codeframe ? `\n${error.codeframe}` : ""}`);
|
||||||
|
if (result.fatal) this.error(diagnostics.join("\n\n") || "React Compiler transform failed.");
|
||||||
|
for (const diagnostic of diagnostics) this.warn(diagnostic);
|
||||||
|
return {
|
||||||
|
code: result.code,
|
||||||
|
map: result.map
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
viteReact.preambleCode = preambleCode;
|
||||||
|
function viteReactForCjs(options) {
|
||||||
|
return viteReact.call(this, options);
|
||||||
|
}
|
||||||
|
Object.assign(viteReactForCjs, {
|
||||||
|
default: viteReactForCjs,
|
||||||
|
reactCompilerPreset
|
||||||
|
});
|
||||||
|
//#endregion
|
||||||
|
export { viteReact as default, viteReactForCjs as "module.exports", reactCompilerPreset };
|
||||||
+685
@@ -0,0 +1,685 @@
|
|||||||
|
/* global window */
|
||||||
|
/* eslint-disable eqeqeq, prefer-const, @typescript-eslint/no-empty-function */
|
||||||
|
|
||||||
|
/*! Copyright (c) Meta Platforms, Inc. and affiliates. **/
|
||||||
|
/**
|
||||||
|
* This is simplified pure-js version of https://github.com/facebook/react/blob/main/packages/react-refresh/src/ReactFreshRuntime.js
|
||||||
|
* without IE11 compatibility and verbose isDev checks.
|
||||||
|
* Some utils are appended at the bottom for HMR integration.
|
||||||
|
*/
|
||||||
|
|
||||||
|
const REACT_FORWARD_REF_TYPE = Symbol.for('react.forward_ref')
|
||||||
|
const REACT_MEMO_TYPE = Symbol.for('react.memo')
|
||||||
|
|
||||||
|
// We never remove these associations.
|
||||||
|
// It's OK to reference families, but use WeakMap/Set for types.
|
||||||
|
let allFamiliesByID = new Map()
|
||||||
|
let allFamiliesByType = new WeakMap()
|
||||||
|
let allSignaturesByType = new WeakMap()
|
||||||
|
|
||||||
|
// This WeakMap is read by React, so we only put families
|
||||||
|
// that have actually been edited here. This keeps checks fast.
|
||||||
|
const updatedFamiliesByType = new WeakMap()
|
||||||
|
|
||||||
|
// This is cleared on every performReactRefresh() call.
|
||||||
|
// It is an array of [Family, NextType] tuples.
|
||||||
|
let pendingUpdates = []
|
||||||
|
|
||||||
|
// This is injected by the renderer via DevTools global hook.
|
||||||
|
const helpersByRendererID = new Map()
|
||||||
|
|
||||||
|
const helpersByRoot = new Map()
|
||||||
|
|
||||||
|
// We keep track of mounted roots so we can schedule updates.
|
||||||
|
const mountedRoots = new Set()
|
||||||
|
// If a root captures an error, we remember it so we can retry on edit.
|
||||||
|
const failedRoots = new Set()
|
||||||
|
|
||||||
|
// We also remember the last element for every root.
|
||||||
|
// It needs to be weak because we do this even for roots that failed to mount.
|
||||||
|
// If there is no WeakMap, we won't attempt to do retrying.
|
||||||
|
let rootElements = new WeakMap()
|
||||||
|
let isPerformingRefresh = false
|
||||||
|
|
||||||
|
function computeFullKey(signature) {
|
||||||
|
if (signature.fullKey !== null) {
|
||||||
|
return signature.fullKey
|
||||||
|
}
|
||||||
|
|
||||||
|
let fullKey = signature.ownKey
|
||||||
|
let hooks
|
||||||
|
try {
|
||||||
|
hooks = signature.getCustomHooks()
|
||||||
|
} catch (err) {
|
||||||
|
// This can happen in an edge case, e.g. if expression like Foo.useSomething
|
||||||
|
// depends on Foo which is lazily initialized during rendering.
|
||||||
|
// In that case just assume we'll have to remount.
|
||||||
|
signature.forceReset = true
|
||||||
|
signature.fullKey = fullKey
|
||||||
|
return fullKey
|
||||||
|
}
|
||||||
|
|
||||||
|
for (let i = 0; i < hooks.length; i++) {
|
||||||
|
const hook = hooks[i]
|
||||||
|
if (typeof hook !== 'function') {
|
||||||
|
// Something's wrong. Assume we need to remount.
|
||||||
|
signature.forceReset = true
|
||||||
|
signature.fullKey = fullKey
|
||||||
|
return fullKey
|
||||||
|
}
|
||||||
|
const nestedHookSignature = allSignaturesByType.get(hook)
|
||||||
|
if (nestedHookSignature === undefined) {
|
||||||
|
// No signature means Hook wasn't in the source code, e.g. in a library.
|
||||||
|
// We'll skip it because we can assume it won't change during this session.
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
const nestedHookKey = computeFullKey(nestedHookSignature)
|
||||||
|
if (nestedHookSignature.forceReset) {
|
||||||
|
signature.forceReset = true
|
||||||
|
}
|
||||||
|
fullKey += '\n---\n' + nestedHookKey
|
||||||
|
}
|
||||||
|
|
||||||
|
signature.fullKey = fullKey
|
||||||
|
return fullKey
|
||||||
|
}
|
||||||
|
|
||||||
|
function haveEqualSignatures(prevType, nextType) {
|
||||||
|
const prevSignature = allSignaturesByType.get(prevType)
|
||||||
|
const nextSignature = allSignaturesByType.get(nextType)
|
||||||
|
|
||||||
|
if (prevSignature === undefined && nextSignature === undefined) {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
if (prevSignature === undefined || nextSignature === undefined) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
if (computeFullKey(prevSignature) !== computeFullKey(nextSignature)) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
if (nextSignature.forceReset) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
function isReactClass(type) {
|
||||||
|
return type.prototype && type.prototype.isReactComponent
|
||||||
|
}
|
||||||
|
|
||||||
|
function canPreserveStateBetween(prevType, nextType) {
|
||||||
|
if (isReactClass(prevType) || isReactClass(nextType)) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
// A fiber's tag is derived from the kind of its type (a plain function
|
||||||
|
// vs memo vs forwardRef), and the reconciler can only swap implementations
|
||||||
|
// in place within the same tag. If the kind changed, the tree must remount.
|
||||||
|
if (typeof prevType !== typeof nextType) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
if (typeof prevType === 'object' && prevType !== null && nextType !== null) {
|
||||||
|
if (
|
||||||
|
getProperty(prevType, '$$typeof') !== getProperty(nextType, '$$typeof')
|
||||||
|
) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
// Switching from SimpleMemoComponent to MemoComponent requires a remount;
|
||||||
|
// for symmetry, remount for the reverse too.
|
||||||
|
if (getProperty(prevType, '$$typeof') === REACT_MEMO_TYPE) {
|
||||||
|
if (
|
||||||
|
(getProperty(prevType, 'compare') === null) !==
|
||||||
|
(getProperty(nextType, 'compare') === null)
|
||||||
|
) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (haveEqualSignatures(prevType, nextType)) {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
function resolveFamily(type) {
|
||||||
|
// Only check updated types to keep lookups fast.
|
||||||
|
return updatedFamiliesByType.get(type)
|
||||||
|
}
|
||||||
|
|
||||||
|
// This is a safety mechanism to protect against rogue getters and Proxies.
|
||||||
|
function getProperty(object, property) {
|
||||||
|
try {
|
||||||
|
return object[property]
|
||||||
|
} catch (err) {
|
||||||
|
// Intentionally ignore.
|
||||||
|
return undefined
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function performReactRefresh() {
|
||||||
|
if (pendingUpdates.length === 0) {
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
if (isPerformingRefresh) {
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
|
||||||
|
isPerformingRefresh = true
|
||||||
|
try {
|
||||||
|
const staleFamilies = new Set()
|
||||||
|
const updatedFamilies = new Set()
|
||||||
|
|
||||||
|
const updates = pendingUpdates
|
||||||
|
pendingUpdates = []
|
||||||
|
updates.forEach(([family, nextType]) => {
|
||||||
|
// Now that we got a real edit, we can create associations
|
||||||
|
// that will be read by the React reconciler.
|
||||||
|
const prevType = family.current
|
||||||
|
updatedFamiliesByType.set(prevType, family)
|
||||||
|
updatedFamiliesByType.set(nextType, family)
|
||||||
|
family.current = nextType
|
||||||
|
|
||||||
|
// Determine whether this should be a re-render or a re-mount.
|
||||||
|
if (canPreserveStateBetween(prevType, nextType)) {
|
||||||
|
updatedFamilies.add(family)
|
||||||
|
} else {
|
||||||
|
staleFamilies.add(family)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
// TODO: rename these fields to something more meaningful.
|
||||||
|
const update = {
|
||||||
|
updatedFamilies, // Families that will re-render preserving state
|
||||||
|
staleFamilies, // Families that will be remounted
|
||||||
|
}
|
||||||
|
|
||||||
|
helpersByRendererID.forEach((helpers) => {
|
||||||
|
// Even if there are no roots, set the handler on first update.
|
||||||
|
// This ensures that if *new* roots are mounted, they'll use the resolve handler.
|
||||||
|
helpers.setRefreshHandler(resolveFamily)
|
||||||
|
})
|
||||||
|
|
||||||
|
let didError = false
|
||||||
|
let firstError = null
|
||||||
|
|
||||||
|
// We snapshot maps and sets that are mutated during commits.
|
||||||
|
// If we don't do this, there is a risk they will be mutated while
|
||||||
|
// we iterate over them. For example, trying to recover a failed root
|
||||||
|
// may cause another root to be added to the failed list -- an infinite loop.
|
||||||
|
const failedRootsSnapshot = new Set(failedRoots)
|
||||||
|
const mountedRootsSnapshot = new Set(mountedRoots)
|
||||||
|
const helpersByRootSnapshot = new Map(helpersByRoot)
|
||||||
|
|
||||||
|
failedRootsSnapshot.forEach((root) => {
|
||||||
|
const helpers = helpersByRootSnapshot.get(root)
|
||||||
|
if (helpers === undefined) {
|
||||||
|
throw new Error(
|
||||||
|
'Could not find helpers for a root. This is a bug in React Refresh.',
|
||||||
|
)
|
||||||
|
}
|
||||||
|
if (!failedRoots.has(root)) {
|
||||||
|
// No longer failed.
|
||||||
|
}
|
||||||
|
if (rootElements === null) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (!rootElements.has(root)) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
const element = rootElements.get(root)
|
||||||
|
try {
|
||||||
|
helpers.scheduleRoot(root, element)
|
||||||
|
} catch (err) {
|
||||||
|
if (!didError) {
|
||||||
|
didError = true
|
||||||
|
firstError = err
|
||||||
|
}
|
||||||
|
// Keep trying other roots.
|
||||||
|
}
|
||||||
|
})
|
||||||
|
mountedRootsSnapshot.forEach((root) => {
|
||||||
|
const helpers = helpersByRootSnapshot.get(root)
|
||||||
|
if (helpers === undefined) {
|
||||||
|
throw new Error(
|
||||||
|
'Could not find helpers for a root. This is a bug in React Refresh.',
|
||||||
|
)
|
||||||
|
}
|
||||||
|
if (!mountedRoots.has(root)) {
|
||||||
|
// No longer mounted.
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
helpers.scheduleRefresh(root, update)
|
||||||
|
} catch (err) {
|
||||||
|
if (!didError) {
|
||||||
|
didError = true
|
||||||
|
firstError = err
|
||||||
|
}
|
||||||
|
// Keep trying other roots.
|
||||||
|
}
|
||||||
|
})
|
||||||
|
if (didError) {
|
||||||
|
throw firstError
|
||||||
|
}
|
||||||
|
return update
|
||||||
|
} finally {
|
||||||
|
isPerformingRefresh = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export function register(type, id) {
|
||||||
|
if (type === null) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (typeof type !== 'function' && typeof type !== 'object') {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// This can happen in an edge case, e.g. if we register
|
||||||
|
// return value of a HOC but it returns a cached component.
|
||||||
|
// Ignore anything but the first registration for each type.
|
||||||
|
if (allFamiliesByType.has(type)) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
// Create family or remember to update it.
|
||||||
|
// None of this bookkeeping affects reconciliation
|
||||||
|
// until the first performReactRefresh() call above.
|
||||||
|
let family = allFamiliesByID.get(id)
|
||||||
|
if (family === undefined) {
|
||||||
|
family = { current: type }
|
||||||
|
allFamiliesByID.set(id, family)
|
||||||
|
} else {
|
||||||
|
pendingUpdates.push([family, type])
|
||||||
|
}
|
||||||
|
allFamiliesByType.set(type, family)
|
||||||
|
|
||||||
|
// Visit inner types because we might not have registered them.
|
||||||
|
if (typeof type === 'object' && type !== null) {
|
||||||
|
switch (getProperty(type, '$$typeof')) {
|
||||||
|
case REACT_FORWARD_REF_TYPE:
|
||||||
|
register(type.render, id + '$render')
|
||||||
|
break
|
||||||
|
case REACT_MEMO_TYPE:
|
||||||
|
register(type.type, id + '$type')
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function setSignature(type, key, forceReset, getCustomHooks) {
|
||||||
|
if (!allSignaturesByType.has(type)) {
|
||||||
|
allSignaturesByType.set(type, {
|
||||||
|
forceReset,
|
||||||
|
ownKey: key,
|
||||||
|
fullKey: null,
|
||||||
|
getCustomHooks: getCustomHooks || (() => []),
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// Visit inner types because we might not have signed them.
|
||||||
|
if (typeof type === 'object' && type !== null) {
|
||||||
|
switch (getProperty(type, '$$typeof')) {
|
||||||
|
case REACT_FORWARD_REF_TYPE:
|
||||||
|
setSignature(type.render, key, forceReset, getCustomHooks)
|
||||||
|
break
|
||||||
|
case REACT_MEMO_TYPE:
|
||||||
|
setSignature(type.type, key, forceReset, getCustomHooks)
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// This is lazily called during first render for a type.
|
||||||
|
// It captures Hook list at that time so inline requires don't break comparisons.
|
||||||
|
function collectCustomHooksForSignature(type) {
|
||||||
|
const signature = allSignaturesByType.get(type)
|
||||||
|
if (signature !== undefined) {
|
||||||
|
computeFullKey(signature)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export function injectIntoGlobalHook(globalObject) {
|
||||||
|
// For React Native, the global hook will be set up by require('react-devtools-core').
|
||||||
|
// That code will run before us. So we need to monkeypatch functions on existing hook.
|
||||||
|
|
||||||
|
// For React Web, the global hook will be set up by the extension.
|
||||||
|
// This will also run before us.
|
||||||
|
let hook = globalObject.__REACT_DEVTOOLS_GLOBAL_HOOK__
|
||||||
|
if (hook === undefined) {
|
||||||
|
// However, if there is no DevTools extension, we'll need to set up the global hook ourselves.
|
||||||
|
// Note that in this case it's important that renderer code runs *after* this method call.
|
||||||
|
// Otherwise, the renderer will think that there is no global hook, and won't do the injection.
|
||||||
|
let nextID = 0
|
||||||
|
globalObject.__REACT_DEVTOOLS_GLOBAL_HOOK__ = hook = {
|
||||||
|
renderers: new Map(),
|
||||||
|
supportsFiber: true,
|
||||||
|
inject: (injected) => nextID++,
|
||||||
|
onScheduleFiberRoot: (id, root, children) => {},
|
||||||
|
onCommitFiberRoot: (id, root, maybePriorityLevel, didError) => {},
|
||||||
|
onCommitFiberUnmount() {},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (hook.isDisabled) {
|
||||||
|
// This isn't a real property on the hook, but it can be set to opt out
|
||||||
|
// of DevTools integration and associated warnings and logs.
|
||||||
|
// Using console['warn'] to evade Babel and ESLint
|
||||||
|
console['warn'](
|
||||||
|
'Something has shimmed the React DevTools global hook (__REACT_DEVTOOLS_GLOBAL_HOOK__). ' +
|
||||||
|
'Fast Refresh is not compatible with this shim and will be disabled.',
|
||||||
|
)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// Here, we just want to get a reference to scheduleRefresh.
|
||||||
|
const oldInject = hook.inject
|
||||||
|
hook.inject = function (injected) {
|
||||||
|
const id = oldInject.apply(this, arguments)
|
||||||
|
if (
|
||||||
|
typeof injected.scheduleRefresh === 'function' &&
|
||||||
|
typeof injected.setRefreshHandler === 'function'
|
||||||
|
) {
|
||||||
|
// This version supports React Refresh.
|
||||||
|
helpersByRendererID.set(id, injected)
|
||||||
|
}
|
||||||
|
return id
|
||||||
|
}
|
||||||
|
|
||||||
|
// Do the same for any already injected roots.
|
||||||
|
// This is useful if ReactDOM has already been initialized.
|
||||||
|
// https://github.com/facebook/react/issues/17626
|
||||||
|
hook.renderers.forEach((injected, id) => {
|
||||||
|
if (
|
||||||
|
typeof injected.scheduleRefresh === 'function' &&
|
||||||
|
typeof injected.setRefreshHandler === 'function'
|
||||||
|
) {
|
||||||
|
// This version supports React Refresh.
|
||||||
|
helpersByRendererID.set(id, injected)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
// We also want to track currently mounted roots.
|
||||||
|
const oldOnCommitFiberRoot = hook.onCommitFiberRoot
|
||||||
|
const oldOnScheduleFiberRoot = hook.onScheduleFiberRoot || (() => {})
|
||||||
|
hook.onScheduleFiberRoot = function (id, root, children) {
|
||||||
|
if (!isPerformingRefresh) {
|
||||||
|
// If it was intentionally scheduled, don't attempt to restore.
|
||||||
|
// This includes intentionally scheduled unmounts.
|
||||||
|
failedRoots.delete(root)
|
||||||
|
if (rootElements !== null) {
|
||||||
|
rootElements.set(root, children)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return oldOnScheduleFiberRoot.apply(this, arguments)
|
||||||
|
}
|
||||||
|
hook.onCommitFiberRoot = function (id, root, maybePriorityLevel, didError) {
|
||||||
|
const helpers = helpersByRendererID.get(id)
|
||||||
|
if (helpers !== undefined) {
|
||||||
|
helpersByRoot.set(root, helpers)
|
||||||
|
|
||||||
|
const current = root.current
|
||||||
|
const alternate = current.alternate
|
||||||
|
|
||||||
|
// We need to determine whether this root has just (un)mounted.
|
||||||
|
// This logic is copy-pasted from similar logic in the DevTools backend.
|
||||||
|
// If this breaks with some refactoring, you'll want to update DevTools too.
|
||||||
|
|
||||||
|
if (alternate !== null) {
|
||||||
|
const wasMounted =
|
||||||
|
alternate.memoizedState != null &&
|
||||||
|
alternate.memoizedState.element != null &&
|
||||||
|
mountedRoots.has(root)
|
||||||
|
|
||||||
|
const isMounted =
|
||||||
|
current.memoizedState != null && current.memoizedState.element != null
|
||||||
|
|
||||||
|
if (!wasMounted && isMounted) {
|
||||||
|
// Mount a new root.
|
||||||
|
mountedRoots.add(root)
|
||||||
|
failedRoots.delete(root)
|
||||||
|
} else if (wasMounted && isMounted) {
|
||||||
|
// Update an existing root.
|
||||||
|
// This doesn't affect our mounted root Set.
|
||||||
|
} else if (wasMounted && !isMounted) {
|
||||||
|
// Unmount an existing root.
|
||||||
|
mountedRoots.delete(root)
|
||||||
|
if (didError) {
|
||||||
|
// We'll remount it on future edits.
|
||||||
|
failedRoots.add(root)
|
||||||
|
} else {
|
||||||
|
helpersByRoot.delete(root)
|
||||||
|
}
|
||||||
|
} else if (!wasMounted && !isMounted) {
|
||||||
|
if (didError) {
|
||||||
|
// We'll remount it on future edits.
|
||||||
|
failedRoots.add(root)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// Mount a new root.
|
||||||
|
mountedRoots.add(root)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Always call the decorated DevTools hook.
|
||||||
|
return oldOnCommitFiberRoot.apply(this, arguments)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// This is a wrapper over more primitive functions for setting signature.
|
||||||
|
// Signatures let us decide whether the Hook order has changed on refresh.
|
||||||
|
//
|
||||||
|
// This function is intended to be used as a transform target, e.g.:
|
||||||
|
// var _s = createSignatureFunctionForTransform()
|
||||||
|
//
|
||||||
|
// function Hello() {
|
||||||
|
// const [foo, setFoo] = useState(0);
|
||||||
|
// const value = useCustomHook();
|
||||||
|
// _s(); /* Call without arguments triggers collecting the custom Hook list.
|
||||||
|
// * This doesn't happen during the module evaluation because we
|
||||||
|
// * don't want to change the module order with inline requires.
|
||||||
|
// * Next calls are noops. */
|
||||||
|
// return <h1>Hi</h1>;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// /* Call with arguments attaches the signature to the type: */
|
||||||
|
// _s(
|
||||||
|
// Hello,
|
||||||
|
// 'useState{[foo, setFoo]}(0)',
|
||||||
|
// () => [useCustomHook], /* Lazy to avoid triggering inline requires */
|
||||||
|
// );
|
||||||
|
export function createSignatureFunctionForTransform() {
|
||||||
|
let savedType
|
||||||
|
let hasCustomHooks
|
||||||
|
let didCollectHooks = false
|
||||||
|
return function (type, key, forceReset, getCustomHooks) {
|
||||||
|
if (typeof key === 'string') {
|
||||||
|
// We're in the initial phase that associates signatures
|
||||||
|
// with the functions. Note this may be called multiple times
|
||||||
|
// in HOC chains like _s(hoc1(_s(hoc2(_s(actualFunction))))).
|
||||||
|
if (!savedType) {
|
||||||
|
// We're in the innermost call, so this is the actual type.
|
||||||
|
// $FlowFixMe[escaped-generic] discovered when updating Flow
|
||||||
|
savedType = type
|
||||||
|
hasCustomHooks = typeof getCustomHooks === 'function'
|
||||||
|
}
|
||||||
|
// Set the signature for all types (even wrappers!) in case
|
||||||
|
// they have no signatures of their own. This is to prevent
|
||||||
|
// problems like https://github.com/facebook/react/issues/20417.
|
||||||
|
if (
|
||||||
|
type != null &&
|
||||||
|
(typeof type === 'function' || typeof type === 'object')
|
||||||
|
) {
|
||||||
|
setSignature(type, key, forceReset, getCustomHooks)
|
||||||
|
}
|
||||||
|
return type
|
||||||
|
} else {
|
||||||
|
// We're in the _s() call without arguments, which means
|
||||||
|
// this is the time to collect custom Hook signatures.
|
||||||
|
// Only do this once. This path is hot and runs *inside* every render!
|
||||||
|
if (!didCollectHooks && hasCustomHooks) {
|
||||||
|
didCollectHooks = true
|
||||||
|
collectCustomHooksForSignature(savedType)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function isLikelyComponentType(type) {
|
||||||
|
switch (typeof type) {
|
||||||
|
case 'function': {
|
||||||
|
// First, deal with classes.
|
||||||
|
if (type.prototype != null) {
|
||||||
|
if (type.prototype.isReactComponent) {
|
||||||
|
// React class.
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
const ownNames = Object.getOwnPropertyNames(type.prototype)
|
||||||
|
if (ownNames.length > 1 || ownNames[0] !== 'constructor') {
|
||||||
|
// This looks like a class.
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
if (type.prototype.__proto__ !== Object.prototype) {
|
||||||
|
// It has a superclass.
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
// Pass through.
|
||||||
|
// This looks like a regular function with empty prototype.
|
||||||
|
}
|
||||||
|
// For plain functions and arrows, use name as a heuristic.
|
||||||
|
const name = type.name || type.displayName
|
||||||
|
return typeof name === 'string' && /^[A-Z]/.test(name)
|
||||||
|
}
|
||||||
|
case 'object': {
|
||||||
|
if (type != null) {
|
||||||
|
switch (getProperty(type, '$$typeof')) {
|
||||||
|
case REACT_FORWARD_REF_TYPE:
|
||||||
|
case REACT_MEMO_TYPE:
|
||||||
|
// Definitely React components.
|
||||||
|
return true
|
||||||
|
default:
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
default: {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function isCompoundComponent(type) {
|
||||||
|
if (!isPlainObject(type)) return false
|
||||||
|
for (const key in type) {
|
||||||
|
if (!isLikelyComponentType(type[key])) return false
|
||||||
|
}
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
function isPlainObject(obj) {
|
||||||
|
return (
|
||||||
|
Object.prototype.toString.call(obj) === '[object Object]' &&
|
||||||
|
(obj.constructor === Object || obj.constructor === undefined)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Plugin utils
|
||||||
|
*/
|
||||||
|
|
||||||
|
// Taken from https://github.com/pmmmwh/react-refresh-webpack-plugin/blob/main/lib/runtime/RefreshUtils.js#L141
|
||||||
|
// This allows to resister components not detected by SWC like styled component
|
||||||
|
export function registerExportsForReactRefresh(filename, moduleExports) {
|
||||||
|
for (const key in moduleExports) {
|
||||||
|
if (key === '__esModule') continue
|
||||||
|
const exportValue = moduleExports[key]
|
||||||
|
if (isLikelyComponentType(exportValue)) {
|
||||||
|
// 'export' is required to avoid key collision when renamed exports that
|
||||||
|
// shadow a local component name: https://github.com/vitejs/vite-plugin-react/issues/116
|
||||||
|
// The register function has an identity check to not register twice the same component,
|
||||||
|
// so this is safe to not used the same key here.
|
||||||
|
register(exportValue, filename + ' export ' + key)
|
||||||
|
} else if (isCompoundComponent(exportValue)) {
|
||||||
|
for (const subKey in exportValue) {
|
||||||
|
register(
|
||||||
|
exportValue[subKey],
|
||||||
|
filename + ' export ' + key + '-' + subKey,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function debounce(fn, delay) {
|
||||||
|
let handle
|
||||||
|
return () => {
|
||||||
|
clearTimeout(handle)
|
||||||
|
handle = setTimeout(fn, delay)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const hooks = []
|
||||||
|
window.__registerBeforePerformReactRefresh = (cb) => {
|
||||||
|
hooks.push(cb)
|
||||||
|
}
|
||||||
|
const enqueueUpdate = debounce(async () => {
|
||||||
|
if (hooks.length) await Promise.all(hooks.map((cb) => cb()))
|
||||||
|
performReactRefresh()
|
||||||
|
}, 16)
|
||||||
|
|
||||||
|
export function validateRefreshBoundaryAndEnqueueUpdate(
|
||||||
|
id,
|
||||||
|
prevExports,
|
||||||
|
nextExports,
|
||||||
|
) {
|
||||||
|
let hasExports = false
|
||||||
|
const ignoredExports = window.__getReactRefreshIgnoredExports?.({ id }) ?? []
|
||||||
|
|
||||||
|
for (const key in prevExports) {
|
||||||
|
if (ignoredExports.includes(key)) continue
|
||||||
|
if (!(key in nextExports)) {
|
||||||
|
return `Could not Fast Refresh (export "${key}" removed)`
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for (const key in nextExports) {
|
||||||
|
if (ignoredExports.includes(key)) continue
|
||||||
|
hasExports = true
|
||||||
|
if (!(key in prevExports)) {
|
||||||
|
return `Could not Fast Refresh (export "${key}" added)`
|
||||||
|
}
|
||||||
|
if (isLikelyComponentType(nextExports[key])) continue
|
||||||
|
if (isCompoundComponent(nextExports[key])) {
|
||||||
|
if (!isCompoundComponent(prevExports[key])) {
|
||||||
|
return `Could not Fast Refresh (compound component "${key}" added)`
|
||||||
|
}
|
||||||
|
for (const subKey in prevExports[key]) {
|
||||||
|
if (!(subKey in nextExports[key])) {
|
||||||
|
return `Could not Fast Refresh (compound component "${key}.${subKey}" removed)`
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for (const subKey in nextExports[key]) {
|
||||||
|
if (!(subKey in prevExports[key])) {
|
||||||
|
return `Could not Fast Refresh (compound component "${key}.${subKey}" added)`
|
||||||
|
}
|
||||||
|
}
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
if (prevExports[key] !== nextExports[key]) {
|
||||||
|
return `Could not Fast Refresh ("${key}" export is incompatible). Learn more at __README_URL__#consistent-components-exports`
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (hasExports) {
|
||||||
|
enqueueUpdate()
|
||||||
|
} else {
|
||||||
|
return `No exports`
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Hides vite-ignored dynamic import so that Vite can skip analysis if no other
|
||||||
|
// dynamic import is present (https://github.com/vitejs/vite/pull/12732)
|
||||||
|
export const __hmr_import = (module) => import(/* @vite-ignore */ module)
|
||||||
|
|
||||||
|
// For backwards compatibility with @vitejs/plugin-react.
|
||||||
|
export default { injectIntoGlobalHook }
|
||||||
+91
@@ -0,0 +1,91 @@
|
|||||||
|
{
|
||||||
|
"name": "@vitejs/plugin-react",
|
||||||
|
"version": "6.1.2",
|
||||||
|
"description": "The default Vite plugin for React projects",
|
||||||
|
"keywords": [
|
||||||
|
"fast refresh",
|
||||||
|
"react",
|
||||||
|
"react-refresh",
|
||||||
|
"vite",
|
||||||
|
"vite-plugin"
|
||||||
|
],
|
||||||
|
"homepage": "https://github.com/vitejs/vite-plugin-react/tree/main/packages/plugin-react#readme",
|
||||||
|
"bugs": {
|
||||||
|
"url": "https://github.com/vitejs/vite-plugin-react/issues"
|
||||||
|
},
|
||||||
|
"license": "MIT",
|
||||||
|
"author": "Evan You",
|
||||||
|
"contributors": [
|
||||||
|
"Alec Larson",
|
||||||
|
"Arnaud Barré"
|
||||||
|
],
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "git+https://github.com/vitejs/vite-plugin-react.git",
|
||||||
|
"directory": "packages/plugin-react"
|
||||||
|
},
|
||||||
|
"files": [
|
||||||
|
"dist",
|
||||||
|
"types"
|
||||||
|
],
|
||||||
|
"type": "module",
|
||||||
|
"imports": {
|
||||||
|
"#optionalTypes": "./types/optionalTypes.d.ts"
|
||||||
|
},
|
||||||
|
"exports": {
|
||||||
|
".": "./dist/index.js",
|
||||||
|
"./preamble": "./types/preamble.d.ts"
|
||||||
|
},
|
||||||
|
"scripts": {
|
||||||
|
"dev": "tsdown --watch ./src --watch ../common",
|
||||||
|
"build": "tsdown",
|
||||||
|
"prepublishOnly": "npm run build",
|
||||||
|
"test-unit": "vitest run"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"@rolldown/pluginutils": "^1.0.1"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"@rolldown/plugin-babel": "^0.2.4",
|
||||||
|
"@vitejs/react-common": "workspace:*",
|
||||||
|
"babel-plugin-react-compiler": "^1.0.0",
|
||||||
|
"oxc-transform-react": "^0.152.0",
|
||||||
|
"react": "^19.3.0",
|
||||||
|
"react-dom": "^19.3.0",
|
||||||
|
"rolldown": "^1.2.12",
|
||||||
|
"tsdown": "^0.23.0",
|
||||||
|
"vite": "^8.3.2"
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"@rolldown/plugin-babel": "^0.1.7 || ^0.2.0",
|
||||||
|
"babel-plugin-react-compiler": "^1.0.0",
|
||||||
|
"oxc-transform-react": "^0.152.0",
|
||||||
|
"vite": "^8.0.0"
|
||||||
|
},
|
||||||
|
"peerDependenciesMeta": {
|
||||||
|
"@rolldown/plugin-babel": {
|
||||||
|
"optional": true
|
||||||
|
},
|
||||||
|
"babel-plugin-react-compiler": {
|
||||||
|
"optional": true
|
||||||
|
},
|
||||||
|
"oxc-transform-react": {
|
||||||
|
"optional": true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": "^20.19.0 || >=22.12.0"
|
||||||
|
},
|
||||||
|
"compatiblePackages": {
|
||||||
|
"schemaVersion": 1,
|
||||||
|
"rolldown": {
|
||||||
|
"type": "compatible",
|
||||||
|
"versions": "^1.0.0",
|
||||||
|
"note": "You can use Rolldown's built-in feature directly."
|
||||||
|
},
|
||||||
|
"rollup": {
|
||||||
|
"type": "incompatible",
|
||||||
|
"reason": "Uses Rolldown-specific APIs or Vite-specific APIs"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
+16
@@ -0,0 +1,16 @@
|
|||||||
|
/* eslint-disable @typescript-eslint/ban-ts-comment */
|
||||||
|
|
||||||
|
// @ts-ignore --- `@rolldown/plugin-babel` is an optional peer dependency, so this may cause an error
|
||||||
|
import type * as pluginBabel from '@rolldown/plugin-babel'
|
||||||
|
// @ts-ignore --- `babel-plugin-react-compiler` is an optional peer dependency, so this may cause an error
|
||||||
|
import type * as babelPluginReactCompiler from 'babel-plugin-react-compiler'
|
||||||
|
// @ts-ignore --- `oxc-transform-react` is an optional peer dependency, so this may cause an error
|
||||||
|
import type * as oxcTransformReact from 'oxc-transform-react'
|
||||||
|
|
||||||
|
// @ts-ignore --- `@rolldown/plugin-babel` is an optional peer dependency, so this may cause an error
|
||||||
|
export type RolldownBabelPreset = pluginBabel.RolldownBabelPreset
|
||||||
|
// @ts-ignore --- `babel-plugin-react-compiler` is an optional peer dependency, so this may cause an error
|
||||||
|
export type ReactCompilerBabelPluginOptions =
|
||||||
|
babelPluginReactCompiler.PluginOptions
|
||||||
|
// @ts-ignore --- `oxc-transform-react` is an optional peer dependency, so this may cause an error
|
||||||
|
export type ReactCompilerOptions = oxcTransformReact.ReactCompilerOptions
|
||||||
+1
@@ -0,0 +1 @@
|
|||||||
|
export {}
|
||||||
+201
@@ -0,0 +1,201 @@
|
|||||||
|
Apache License
|
||||||
|
Version 2.0, January 2004
|
||||||
|
http://www.apache.org/licenses/
|
||||||
|
|
||||||
|
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||||
|
|
||||||
|
1. Definitions.
|
||||||
|
|
||||||
|
"License" shall mean the terms and conditions for use, reproduction,
|
||||||
|
and distribution as defined by Sections 1 through 9 of this document.
|
||||||
|
|
||||||
|
"Licensor" shall mean the copyright owner or entity authorized by
|
||||||
|
the copyright owner that is granting the License.
|
||||||
|
|
||||||
|
"Legal Entity" shall mean the union of the acting entity and all
|
||||||
|
other entities that control, are controlled by, or are under common
|
||||||
|
control with that entity. For the purposes of this definition,
|
||||||
|
"control" means (i) the power, direct or indirect, to cause the
|
||||||
|
direction or management of such entity, whether by contract or
|
||||||
|
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||||
|
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||||
|
|
||||||
|
"You" (or "Your") shall mean an individual or Legal Entity
|
||||||
|
exercising permissions granted by this License.
|
||||||
|
|
||||||
|
"Source" form shall mean the preferred form for making modifications,
|
||||||
|
including but not limited to software source code, documentation
|
||||||
|
source, and configuration files.
|
||||||
|
|
||||||
|
"Object" form shall mean any form resulting from mechanical
|
||||||
|
transformation or translation of a Source form, including but
|
||||||
|
not limited to compiled object code, generated documentation,
|
||||||
|
and conversions to other media types.
|
||||||
|
|
||||||
|
"Work" shall mean the work of authorship, whether in Source or
|
||||||
|
Object form, made available under the License, as indicated by a
|
||||||
|
copyright notice that is included in or attached to the work
|
||||||
|
(an example is provided in the Appendix below).
|
||||||
|
|
||||||
|
"Derivative Works" shall mean any work, whether in Source or Object
|
||||||
|
form, that is based on (or derived from) the Work and for which the
|
||||||
|
editorial revisions, annotations, elaborations, or other modifications
|
||||||
|
represent, as a whole, an original work of authorship. For the purposes
|
||||||
|
of this License, Derivative Works shall not include works that remain
|
||||||
|
separable from, or merely link (or bind by name) to the interfaces of,
|
||||||
|
the Work and Derivative Works thereof.
|
||||||
|
|
||||||
|
"Contribution" shall mean any work of authorship, including
|
||||||
|
the original version of the Work and any modifications or additions
|
||||||
|
to that Work or Derivative Works thereof, that is intentionally
|
||||||
|
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||||
|
or by an individual or Legal Entity authorized to submit on behalf of
|
||||||
|
the copyright owner. For the purposes of this definition, "submitted"
|
||||||
|
means any form of electronic, verbal, or written communication sent
|
||||||
|
to the Licensor or its representatives, including but not limited to
|
||||||
|
communication on electronic mailing lists, source code control systems,
|
||||||
|
and issue tracking systems that are managed by, or on behalf of, the
|
||||||
|
Licensor for the purpose of discussing and improving the Work, but
|
||||||
|
excluding communication that is conspicuously marked or otherwise
|
||||||
|
designated in writing by the copyright owner as "Not a Contribution."
|
||||||
|
|
||||||
|
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||||
|
on behalf of whom a Contribution has been received by Licensor and
|
||||||
|
subsequently incorporated within the Work.
|
||||||
|
|
||||||
|
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||||
|
this License, each Contributor hereby grants to You a perpetual,
|
||||||
|
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||||
|
copyright license to reproduce, prepare Derivative Works of,
|
||||||
|
publicly display, publicly perform, sublicense, and distribute the
|
||||||
|
Work and such Derivative Works in Source or Object form.
|
||||||
|
|
||||||
|
3. Grant of Patent License. Subject to the terms and conditions of
|
||||||
|
this License, each Contributor hereby grants to You a perpetual,
|
||||||
|
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||||
|
(except as stated in this section) patent license to make, have made,
|
||||||
|
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||||
|
where such license applies only to those patent claims licensable
|
||||||
|
by such Contributor that are necessarily infringed by their
|
||||||
|
Contribution(s) alone or by combination of their Contribution(s)
|
||||||
|
with the Work to which such Contribution(s) was submitted. If You
|
||||||
|
institute patent litigation against any entity (including a
|
||||||
|
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||||
|
or a Contribution incorporated within the Work constitutes direct
|
||||||
|
or contributory patent infringement, then any patent licenses
|
||||||
|
granted to You under this License for that Work shall terminate
|
||||||
|
as of the date such litigation is filed.
|
||||||
|
|
||||||
|
4. Redistribution. You may reproduce and distribute copies of the
|
||||||
|
Work or Derivative Works thereof in any medium, with or without
|
||||||
|
modifications, and in Source or Object form, provided that You
|
||||||
|
meet the following conditions:
|
||||||
|
|
||||||
|
(a) You must give any other recipients of the Work or
|
||||||
|
Derivative Works a copy of this License; and
|
||||||
|
|
||||||
|
(b) You must cause any modified files to carry prominent notices
|
||||||
|
stating that You changed the files; and
|
||||||
|
|
||||||
|
(c) You must retain, in the Source form of any Derivative Works
|
||||||
|
that You distribute, all copyright, patent, trademark, and
|
||||||
|
attribution notices from the Source form of the Work,
|
||||||
|
excluding those notices that do not pertain to any part of
|
||||||
|
the Derivative Works; and
|
||||||
|
|
||||||
|
(d) If the Work includes a "NOTICE" text file as part of its
|
||||||
|
distribution, then any Derivative Works that You distribute must
|
||||||
|
include a readable copy of the attribution notices contained
|
||||||
|
within such NOTICE file, excluding those notices that do not
|
||||||
|
pertain to any part of the Derivative Works, in at least one
|
||||||
|
of the following places: within a NOTICE text file distributed
|
||||||
|
as part of the Derivative Works; within the Source form or
|
||||||
|
documentation, if provided along with the Derivative Works; or,
|
||||||
|
within a display generated by the Derivative Works, if and
|
||||||
|
wherever such third-party notices normally appear. The contents
|
||||||
|
of the NOTICE file are for informational purposes only and
|
||||||
|
do not modify the License. You may add Your own attribution
|
||||||
|
notices within Derivative Works that You distribute, alongside
|
||||||
|
or as an addendum to the NOTICE text from the Work, provided
|
||||||
|
that such additional attribution notices cannot be construed
|
||||||
|
as modifying the License.
|
||||||
|
|
||||||
|
You may add Your own copyright statement to Your modifications and
|
||||||
|
may provide additional or different license terms and conditions
|
||||||
|
for use, reproduction, or distribution of Your modifications, or
|
||||||
|
for any such Derivative Works as a whole, provided Your use,
|
||||||
|
reproduction, and distribution of the Work otherwise complies with
|
||||||
|
the conditions stated in this License.
|
||||||
|
|
||||||
|
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||||
|
any Contribution intentionally submitted for inclusion in the Work
|
||||||
|
by You to the Licensor shall be under the terms and conditions of
|
||||||
|
this License, without any additional terms or conditions.
|
||||||
|
Notwithstanding the above, nothing herein shall supersede or modify
|
||||||
|
the terms of any separate license agreement you may have executed
|
||||||
|
with Licensor regarding such Contributions.
|
||||||
|
|
||||||
|
6. Trademarks. This License does not grant permission to use the trade
|
||||||
|
names, trademarks, service marks, or product names of the Licensor,
|
||||||
|
except as required for reasonable and customary use in describing the
|
||||||
|
origin of the Work and reproducing the content of the NOTICE file.
|
||||||
|
|
||||||
|
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||||
|
agreed to in writing, Licensor provides the Work (and each
|
||||||
|
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||||
|
implied, including, without limitation, any warranties or conditions
|
||||||
|
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||||
|
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||||
|
appropriateness of using or redistributing the Work and assume any
|
||||||
|
risks associated with Your exercise of permissions under this License.
|
||||||
|
|
||||||
|
8. Limitation of Liability. In no event and under no legal theory,
|
||||||
|
whether in tort (including negligence), contract, or otherwise,
|
||||||
|
unless required by applicable law (such as deliberate and grossly
|
||||||
|
negligent acts) or agreed to in writing, shall any Contributor be
|
||||||
|
liable to You for damages, including any direct, indirect, special,
|
||||||
|
incidental, or consequential damages of any character arising as a
|
||||||
|
result of this License or out of the use or inability to use the
|
||||||
|
Work (including but not limited to damages for loss of goodwill,
|
||||||
|
work stoppage, computer failure or malfunction, or any and all
|
||||||
|
other commercial damages or losses), even if such Contributor
|
||||||
|
has been advised of the possibility of such damages.
|
||||||
|
|
||||||
|
9. Accepting Warranty or Additional Liability. While redistributing
|
||||||
|
the Work or Derivative Works thereof, You may choose to offer,
|
||||||
|
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||||
|
or other liability obligations and/or rights consistent with this
|
||||||
|
License. However, in accepting such obligations, You may act only
|
||||||
|
on Your own behalf and on Your sole responsibility, not on behalf
|
||||||
|
of any other Contributor, and only if You agree to indemnify,
|
||||||
|
defend, and hold each Contributor harmless for any liability
|
||||||
|
incurred by, or claims asserted against, such Contributor by reason
|
||||||
|
of your accepting any such warranty or additional liability.
|
||||||
|
|
||||||
|
END OF TERMS AND CONDITIONS
|
||||||
|
|
||||||
|
APPENDIX: How to apply the Apache License to your work.
|
||||||
|
|
||||||
|
To apply the Apache License to your work, attach the following
|
||||||
|
boilerplate notice, with the fields enclosed by brackets "{}"
|
||||||
|
replaced with your own identifying information. (Don't include
|
||||||
|
the brackets!) The text should be enclosed in the appropriate
|
||||||
|
comment syntax for the file format. We also recommend that a
|
||||||
|
file or class name and description of purpose be included on the
|
||||||
|
same "printed page" as the copyright notice for easier
|
||||||
|
identification within third-party archives.
|
||||||
|
|
||||||
|
Copyright {yyyy} {name of copyright owner}
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
||||||
+163
@@ -0,0 +1,163 @@
|
|||||||
|
# detect-libc
|
||||||
|
|
||||||
|
Node.js module to detect details of the C standard library (libc)
|
||||||
|
implementation provided by a given Linux system.
|
||||||
|
|
||||||
|
Currently supports detection of GNU glibc and MUSL libc.
|
||||||
|
|
||||||
|
Provides asychronous and synchronous functions for the
|
||||||
|
family (e.g. `glibc`, `musl`) and version (e.g. `1.23`, `1.2.3`).
|
||||||
|
|
||||||
|
The version numbers of libc implementations
|
||||||
|
are not guaranteed to be semver-compliant.
|
||||||
|
|
||||||
|
For previous v1.x releases, please see the
|
||||||
|
[v1](https://github.com/lovell/detect-libc/tree/v1) branch.
|
||||||
|
|
||||||
|
## Install
|
||||||
|
|
||||||
|
```sh
|
||||||
|
npm install detect-libc
|
||||||
|
```
|
||||||
|
|
||||||
|
## API
|
||||||
|
|
||||||
|
### GLIBC
|
||||||
|
|
||||||
|
```ts
|
||||||
|
const GLIBC: string = 'glibc';
|
||||||
|
```
|
||||||
|
|
||||||
|
A String constant containing the value `glibc`.
|
||||||
|
|
||||||
|
### MUSL
|
||||||
|
|
||||||
|
```ts
|
||||||
|
const MUSL: string = 'musl';
|
||||||
|
```
|
||||||
|
|
||||||
|
A String constant containing the value `musl`.
|
||||||
|
|
||||||
|
### family
|
||||||
|
|
||||||
|
```ts
|
||||||
|
function family(): Promise<string | null>;
|
||||||
|
```
|
||||||
|
|
||||||
|
Resolves asychronously with:
|
||||||
|
|
||||||
|
* `glibc` or `musl` when the libc family can be determined
|
||||||
|
* `null` when the libc family cannot be determined
|
||||||
|
* `null` when run on a non-Linux platform
|
||||||
|
|
||||||
|
```js
|
||||||
|
const { family, GLIBC, MUSL } = require('detect-libc');
|
||||||
|
|
||||||
|
switch (await family()) {
|
||||||
|
case GLIBC: ...
|
||||||
|
case MUSL: ...
|
||||||
|
case null: ...
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### familySync
|
||||||
|
|
||||||
|
```ts
|
||||||
|
function familySync(): string | null;
|
||||||
|
```
|
||||||
|
|
||||||
|
Synchronous version of `family()`.
|
||||||
|
|
||||||
|
```js
|
||||||
|
const { familySync, GLIBC, MUSL } = require('detect-libc');
|
||||||
|
|
||||||
|
switch (familySync()) {
|
||||||
|
case GLIBC: ...
|
||||||
|
case MUSL: ...
|
||||||
|
case null: ...
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### version
|
||||||
|
|
||||||
|
```ts
|
||||||
|
function version(): Promise<string | null>;
|
||||||
|
```
|
||||||
|
|
||||||
|
Resolves asychronously with:
|
||||||
|
|
||||||
|
* The version when it can be determined
|
||||||
|
* `null` when the libc family cannot be determined
|
||||||
|
* `null` when run on a non-Linux platform
|
||||||
|
|
||||||
|
```js
|
||||||
|
const { version } = require('detect-libc');
|
||||||
|
|
||||||
|
const v = await version();
|
||||||
|
if (v) {
|
||||||
|
const [major, minor, patch] = v.split('.');
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### versionSync
|
||||||
|
|
||||||
|
```ts
|
||||||
|
function versionSync(): string | null;
|
||||||
|
```
|
||||||
|
|
||||||
|
Synchronous version of `version()`.
|
||||||
|
|
||||||
|
```js
|
||||||
|
const { versionSync } = require('detect-libc');
|
||||||
|
|
||||||
|
const v = versionSync();
|
||||||
|
if (v) {
|
||||||
|
const [major, minor, patch] = v.split('.');
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### isNonGlibcLinux
|
||||||
|
|
||||||
|
```ts
|
||||||
|
function isNonGlibcLinux(): Promise<boolean>;
|
||||||
|
```
|
||||||
|
|
||||||
|
Resolves asychronously with:
|
||||||
|
|
||||||
|
* `false` when the libc family is `glibc`
|
||||||
|
* `true` when the libc family is not `glibc`
|
||||||
|
* `false` when run on a non-Linux platform
|
||||||
|
|
||||||
|
```js
|
||||||
|
const { isNonGlibcLinux } = require('detect-libc');
|
||||||
|
|
||||||
|
if (await isNonGlibcLinux()) { ... }
|
||||||
|
```
|
||||||
|
|
||||||
|
### isNonGlibcLinuxSync
|
||||||
|
|
||||||
|
```ts
|
||||||
|
function isNonGlibcLinuxSync(): boolean;
|
||||||
|
```
|
||||||
|
|
||||||
|
Synchronous version of `isNonGlibcLinux()`.
|
||||||
|
|
||||||
|
```js
|
||||||
|
const { isNonGlibcLinuxSync } = require('detect-libc');
|
||||||
|
|
||||||
|
if (isNonGlibcLinuxSync()) { ... }
|
||||||
|
```
|
||||||
|
|
||||||
|
## Licensing
|
||||||
|
|
||||||
|
Copyright 2017 Lovell Fuller and others.
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at [http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0.html)
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
||||||
+14
@@ -0,0 +1,14 @@
|
|||||||
|
// Copyright 2017 Lovell Fuller and others.
|
||||||
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
|
export const GLIBC: 'glibc';
|
||||||
|
export const MUSL: 'musl';
|
||||||
|
|
||||||
|
export function family(): Promise<string | null>;
|
||||||
|
export function familySync(): string | null;
|
||||||
|
|
||||||
|
export function isNonGlibcLinux(): Promise<boolean>;
|
||||||
|
export function isNonGlibcLinuxSync(): boolean;
|
||||||
|
|
||||||
|
export function version(): Promise<string | null>;
|
||||||
|
export function versionSync(): string | null;
|
||||||
+313
@@ -0,0 +1,313 @@
|
|||||||
|
// Copyright 2017 Lovell Fuller and others.
|
||||||
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
|
'use strict';
|
||||||
|
|
||||||
|
const childProcess = require('child_process');
|
||||||
|
const { isLinux, getReport } = require('./process');
|
||||||
|
const { LDD_PATH, SELF_PATH, readFile, readFileSync } = require('./filesystem');
|
||||||
|
const { interpreterPath } = require('./elf');
|
||||||
|
|
||||||
|
let cachedFamilyInterpreter;
|
||||||
|
let cachedFamilyFilesystem;
|
||||||
|
let cachedVersionFilesystem;
|
||||||
|
|
||||||
|
const command = 'getconf GNU_LIBC_VERSION 2>&1 || true; ldd --version 2>&1 || true';
|
||||||
|
let commandOut = '';
|
||||||
|
|
||||||
|
const safeCommand = () => {
|
||||||
|
if (!commandOut) {
|
||||||
|
return new Promise((resolve) => {
|
||||||
|
childProcess.exec(command, (err, out) => {
|
||||||
|
commandOut = err ? ' ' : out;
|
||||||
|
resolve(commandOut);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return commandOut;
|
||||||
|
};
|
||||||
|
|
||||||
|
const safeCommandSync = () => {
|
||||||
|
if (!commandOut) {
|
||||||
|
try {
|
||||||
|
commandOut = childProcess.execSync(command, { encoding: 'utf8' });
|
||||||
|
} catch (_err) {
|
||||||
|
commandOut = ' ';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return commandOut;
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A String constant containing the value `glibc`.
|
||||||
|
* @type {string}
|
||||||
|
* @public
|
||||||
|
*/
|
||||||
|
const GLIBC = 'glibc';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A Regexp constant to get the GLIBC Version.
|
||||||
|
* @type {string}
|
||||||
|
*/
|
||||||
|
const RE_GLIBC_VERSION = /LIBC[a-z0-9 \-).]*?(\d+\.\d+)/i;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A String constant containing the value `musl`.
|
||||||
|
* @type {string}
|
||||||
|
* @public
|
||||||
|
*/
|
||||||
|
const MUSL = 'musl';
|
||||||
|
|
||||||
|
const isFileMusl = (f) => f.includes('libc.musl-') || f.includes('ld-musl-');
|
||||||
|
|
||||||
|
const familyFromReport = () => {
|
||||||
|
const report = getReport();
|
||||||
|
if (report.header && report.header.glibcVersionRuntime) {
|
||||||
|
return GLIBC;
|
||||||
|
}
|
||||||
|
if (Array.isArray(report.sharedObjects)) {
|
||||||
|
if (report.sharedObjects.some(isFileMusl)) {
|
||||||
|
return MUSL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
};
|
||||||
|
|
||||||
|
const familyFromCommand = (out) => {
|
||||||
|
const [getconf, ldd1] = out.split(/[\r\n]+/);
|
||||||
|
if (getconf && getconf.includes(GLIBC)) {
|
||||||
|
return GLIBC;
|
||||||
|
}
|
||||||
|
if (ldd1 && ldd1.includes(MUSL)) {
|
||||||
|
return MUSL;
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
};
|
||||||
|
|
||||||
|
const familyFromInterpreterPath = (path) => {
|
||||||
|
if (path) {
|
||||||
|
if (path.includes('/ld-musl-')) {
|
||||||
|
return MUSL;
|
||||||
|
} else if (path.includes('/ld-linux-')) {
|
||||||
|
return GLIBC;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
};
|
||||||
|
|
||||||
|
const getFamilyFromLddContent = (content) => {
|
||||||
|
content = content.toString();
|
||||||
|
if (content.includes('musl')) {
|
||||||
|
return MUSL;
|
||||||
|
}
|
||||||
|
if (content.includes('GNU C Library')) {
|
||||||
|
return GLIBC;
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
};
|
||||||
|
|
||||||
|
const familyFromFilesystem = async () => {
|
||||||
|
if (cachedFamilyFilesystem !== undefined) {
|
||||||
|
return cachedFamilyFilesystem;
|
||||||
|
}
|
||||||
|
cachedFamilyFilesystem = null;
|
||||||
|
try {
|
||||||
|
const lddContent = await readFile(LDD_PATH);
|
||||||
|
cachedFamilyFilesystem = getFamilyFromLddContent(lddContent);
|
||||||
|
} catch (e) {}
|
||||||
|
return cachedFamilyFilesystem;
|
||||||
|
};
|
||||||
|
|
||||||
|
const familyFromFilesystemSync = () => {
|
||||||
|
if (cachedFamilyFilesystem !== undefined) {
|
||||||
|
return cachedFamilyFilesystem;
|
||||||
|
}
|
||||||
|
cachedFamilyFilesystem = null;
|
||||||
|
try {
|
||||||
|
const lddContent = readFileSync(LDD_PATH);
|
||||||
|
cachedFamilyFilesystem = getFamilyFromLddContent(lddContent);
|
||||||
|
} catch (e) {}
|
||||||
|
return cachedFamilyFilesystem;
|
||||||
|
};
|
||||||
|
|
||||||
|
const familyFromInterpreter = async () => {
|
||||||
|
if (cachedFamilyInterpreter !== undefined) {
|
||||||
|
return cachedFamilyInterpreter;
|
||||||
|
}
|
||||||
|
cachedFamilyInterpreter = null;
|
||||||
|
try {
|
||||||
|
const selfContent = await readFile(SELF_PATH);
|
||||||
|
const path = interpreterPath(selfContent);
|
||||||
|
cachedFamilyInterpreter = familyFromInterpreterPath(path);
|
||||||
|
} catch (e) {}
|
||||||
|
return cachedFamilyInterpreter;
|
||||||
|
};
|
||||||
|
|
||||||
|
const familyFromInterpreterSync = () => {
|
||||||
|
if (cachedFamilyInterpreter !== undefined) {
|
||||||
|
return cachedFamilyInterpreter;
|
||||||
|
}
|
||||||
|
cachedFamilyInterpreter = null;
|
||||||
|
try {
|
||||||
|
const selfContent = readFileSync(SELF_PATH);
|
||||||
|
const path = interpreterPath(selfContent);
|
||||||
|
cachedFamilyInterpreter = familyFromInterpreterPath(path);
|
||||||
|
} catch (e) {}
|
||||||
|
return cachedFamilyInterpreter;
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Resolves with the libc family when it can be determined, `null` otherwise.
|
||||||
|
* @returns {Promise<?string>}
|
||||||
|
*/
|
||||||
|
const family = async () => {
|
||||||
|
let family = null;
|
||||||
|
if (isLinux()) {
|
||||||
|
family = await familyFromInterpreter();
|
||||||
|
if (!family) {
|
||||||
|
family = await familyFromFilesystem();
|
||||||
|
if (!family) {
|
||||||
|
family = familyFromReport();
|
||||||
|
}
|
||||||
|
if (!family) {
|
||||||
|
const out = await safeCommand();
|
||||||
|
family = familyFromCommand(out);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return family;
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the libc family when it can be determined, `null` otherwise.
|
||||||
|
* @returns {?string}
|
||||||
|
*/
|
||||||
|
const familySync = () => {
|
||||||
|
let family = null;
|
||||||
|
if (isLinux()) {
|
||||||
|
family = familyFromInterpreterSync();
|
||||||
|
if (!family) {
|
||||||
|
family = familyFromFilesystemSync();
|
||||||
|
if (!family) {
|
||||||
|
family = familyFromReport();
|
||||||
|
}
|
||||||
|
if (!family) {
|
||||||
|
const out = safeCommandSync();
|
||||||
|
family = familyFromCommand(out);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return family;
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Resolves `true` only when the platform is Linux and the libc family is not `glibc`.
|
||||||
|
* @returns {Promise<boolean>}
|
||||||
|
*/
|
||||||
|
const isNonGlibcLinux = async () => isLinux() && await family() !== GLIBC;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns `true` only when the platform is Linux and the libc family is not `glibc`.
|
||||||
|
* @returns {boolean}
|
||||||
|
*/
|
||||||
|
const isNonGlibcLinuxSync = () => isLinux() && familySync() !== GLIBC;
|
||||||
|
|
||||||
|
const versionFromFilesystem = async () => {
|
||||||
|
if (cachedVersionFilesystem !== undefined) {
|
||||||
|
return cachedVersionFilesystem;
|
||||||
|
}
|
||||||
|
cachedVersionFilesystem = null;
|
||||||
|
try {
|
||||||
|
const lddContent = await readFile(LDD_PATH);
|
||||||
|
const versionMatch = lddContent.match(RE_GLIBC_VERSION);
|
||||||
|
if (versionMatch) {
|
||||||
|
cachedVersionFilesystem = versionMatch[1];
|
||||||
|
}
|
||||||
|
} catch (e) {}
|
||||||
|
return cachedVersionFilesystem;
|
||||||
|
};
|
||||||
|
|
||||||
|
const versionFromFilesystemSync = () => {
|
||||||
|
if (cachedVersionFilesystem !== undefined) {
|
||||||
|
return cachedVersionFilesystem;
|
||||||
|
}
|
||||||
|
cachedVersionFilesystem = null;
|
||||||
|
try {
|
||||||
|
const lddContent = readFileSync(LDD_PATH);
|
||||||
|
const versionMatch = lddContent.match(RE_GLIBC_VERSION);
|
||||||
|
if (versionMatch) {
|
||||||
|
cachedVersionFilesystem = versionMatch[1];
|
||||||
|
}
|
||||||
|
} catch (e) {}
|
||||||
|
return cachedVersionFilesystem;
|
||||||
|
};
|
||||||
|
|
||||||
|
const versionFromReport = () => {
|
||||||
|
const report = getReport();
|
||||||
|
if (report.header && report.header.glibcVersionRuntime) {
|
||||||
|
return report.header.glibcVersionRuntime;
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
};
|
||||||
|
|
||||||
|
const versionSuffix = (s) => s.trim().split(/\s+/)[1];
|
||||||
|
|
||||||
|
const versionFromCommand = (out) => {
|
||||||
|
const [getconf, ldd1, ldd2] = out.split(/[\r\n]+/);
|
||||||
|
if (getconf && getconf.includes(GLIBC)) {
|
||||||
|
return versionSuffix(getconf);
|
||||||
|
}
|
||||||
|
if (ldd1 && ldd2 && ldd1.includes(MUSL)) {
|
||||||
|
return versionSuffix(ldd2);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Resolves with the libc version when it can be determined, `null` otherwise.
|
||||||
|
* @returns {Promise<?string>}
|
||||||
|
*/
|
||||||
|
const version = async () => {
|
||||||
|
let version = null;
|
||||||
|
if (isLinux()) {
|
||||||
|
version = await versionFromFilesystem();
|
||||||
|
if (!version) {
|
||||||
|
version = versionFromReport();
|
||||||
|
}
|
||||||
|
if (!version) {
|
||||||
|
const out = await safeCommand();
|
||||||
|
version = versionFromCommand(out);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return version;
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the libc version when it can be determined, `null` otherwise.
|
||||||
|
* @returns {?string}
|
||||||
|
*/
|
||||||
|
const versionSync = () => {
|
||||||
|
let version = null;
|
||||||
|
if (isLinux()) {
|
||||||
|
version = versionFromFilesystemSync();
|
||||||
|
if (!version) {
|
||||||
|
version = versionFromReport();
|
||||||
|
}
|
||||||
|
if (!version) {
|
||||||
|
const out = safeCommandSync();
|
||||||
|
version = versionFromCommand(out);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return version;
|
||||||
|
};
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
GLIBC,
|
||||||
|
MUSL,
|
||||||
|
family,
|
||||||
|
familySync,
|
||||||
|
isNonGlibcLinux,
|
||||||
|
isNonGlibcLinuxSync,
|
||||||
|
version,
|
||||||
|
versionSync
|
||||||
|
};
|
||||||
+39
@@ -0,0 +1,39 @@
|
|||||||
|
// Copyright 2017 Lovell Fuller and others.
|
||||||
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
|
'use strict';
|
||||||
|
|
||||||
|
const interpreterPath = (elf) => {
|
||||||
|
if (elf.length < 64) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
if (elf.readUInt32BE(0) !== 0x7F454C46) {
|
||||||
|
// Unexpected magic bytes
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
if (elf.readUInt8(4) !== 2) {
|
||||||
|
// Not a 64-bit ELF
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
if (elf.readUInt8(5) !== 1) {
|
||||||
|
// Not little-endian
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
const offset = elf.readUInt32LE(32);
|
||||||
|
const size = elf.readUInt16LE(54);
|
||||||
|
const count = elf.readUInt16LE(56);
|
||||||
|
for (let i = 0; i < count; i++) {
|
||||||
|
const headerOffset = offset + (i * size);
|
||||||
|
const type = elf.readUInt32LE(headerOffset);
|
||||||
|
if (type === 3) {
|
||||||
|
const fileOffset = elf.readUInt32LE(headerOffset + 8);
|
||||||
|
const fileSize = elf.readUInt32LE(headerOffset + 32);
|
||||||
|
return elf.subarray(fileOffset, fileOffset + fileSize).toString().replace(/\0.*$/g, '');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
};
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
interpreterPath
|
||||||
|
};
|
||||||
+51
@@ -0,0 +1,51 @@
|
|||||||
|
// Copyright 2017 Lovell Fuller and others.
|
||||||
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
|
'use strict';
|
||||||
|
|
||||||
|
const fs = require('fs');
|
||||||
|
|
||||||
|
const LDD_PATH = '/usr/bin/ldd';
|
||||||
|
const SELF_PATH = '/proc/self/exe';
|
||||||
|
const MAX_LENGTH = 2048;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Read the content of a file synchronous
|
||||||
|
*
|
||||||
|
* @param {string} path
|
||||||
|
* @returns {Buffer}
|
||||||
|
*/
|
||||||
|
const readFileSync = (path) => {
|
||||||
|
const fd = fs.openSync(path, 'r');
|
||||||
|
const buffer = Buffer.alloc(MAX_LENGTH);
|
||||||
|
const bytesRead = fs.readSync(fd, buffer, 0, MAX_LENGTH, 0);
|
||||||
|
fs.close(fd, () => {});
|
||||||
|
return buffer.subarray(0, bytesRead);
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Read the content of a file
|
||||||
|
*
|
||||||
|
* @param {string} path
|
||||||
|
* @returns {Promise<Buffer>}
|
||||||
|
*/
|
||||||
|
const readFile = (path) => new Promise((resolve, reject) => {
|
||||||
|
fs.open(path, 'r', (err, fd) => {
|
||||||
|
if (err) {
|
||||||
|
reject(err);
|
||||||
|
} else {
|
||||||
|
const buffer = Buffer.alloc(MAX_LENGTH);
|
||||||
|
fs.read(fd, buffer, 0, MAX_LENGTH, 0, (_, bytesRead) => {
|
||||||
|
resolve(buffer.subarray(0, bytesRead));
|
||||||
|
fs.close(fd, () => {});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
LDD_PATH,
|
||||||
|
SELF_PATH,
|
||||||
|
readFileSync,
|
||||||
|
readFile
|
||||||
|
};
|
||||||
+24
@@ -0,0 +1,24 @@
|
|||||||
|
// Copyright 2017 Lovell Fuller and others.
|
||||||
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
|
'use strict';
|
||||||
|
|
||||||
|
const isLinux = () => process.platform === 'linux';
|
||||||
|
|
||||||
|
let report = null;
|
||||||
|
const getReport = () => {
|
||||||
|
if (!report) {
|
||||||
|
/* istanbul ignore next */
|
||||||
|
if (isLinux() && process.report) {
|
||||||
|
const orig = process.report.excludeNetwork;
|
||||||
|
process.report.excludeNetwork = true;
|
||||||
|
report = process.report.getReport();
|
||||||
|
process.report.excludeNetwork = orig;
|
||||||
|
} else {
|
||||||
|
report = {};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return report;
|
||||||
|
};
|
||||||
|
|
||||||
|
module.exports = { isLinux, getReport };
|
||||||
+44
@@ -0,0 +1,44 @@
|
|||||||
|
{
|
||||||
|
"name": "detect-libc",
|
||||||
|
"version": "2.1.2",
|
||||||
|
"description": "Node.js module to detect the C standard library (libc) implementation family and version",
|
||||||
|
"main": "lib/detect-libc.js",
|
||||||
|
"files": [
|
||||||
|
"lib/",
|
||||||
|
"index.d.ts"
|
||||||
|
],
|
||||||
|
"scripts": {
|
||||||
|
"test": "semistandard && nyc --reporter=text --check-coverage --branches=100 ava test/unit.js",
|
||||||
|
"changelog": "conventional-changelog -i CHANGELOG.md -s",
|
||||||
|
"bench": "node benchmark/detect-libc",
|
||||||
|
"bench:calls": "node benchmark/call-familySync.js && sleep 1 && node benchmark/call-isNonGlibcLinuxSync.js && sleep 1 && node benchmark/call-versionSync.js"
|
||||||
|
},
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "git://github.com/lovell/detect-libc.git"
|
||||||
|
},
|
||||||
|
"keywords": [
|
||||||
|
"libc",
|
||||||
|
"glibc",
|
||||||
|
"musl"
|
||||||
|
],
|
||||||
|
"author": "Lovell Fuller <npm@lovell.info>",
|
||||||
|
"contributors": [
|
||||||
|
"Niklas Salmoukas <niklas@salmoukas.com>",
|
||||||
|
"Vinícius Lourenço <vinyygamerlol@gmail.com>"
|
||||||
|
],
|
||||||
|
"license": "Apache-2.0",
|
||||||
|
"devDependencies": {
|
||||||
|
"ava": "^2.4.0",
|
||||||
|
"benchmark": "^2.1.4",
|
||||||
|
"conventional-changelog-cli": "^5.0.0",
|
||||||
|
"eslint-config-standard": "^13.0.1",
|
||||||
|
"nyc": "^15.1.0",
|
||||||
|
"proxyquire": "^2.1.3",
|
||||||
|
"semistandard": "^14.2.3"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=8"
|
||||||
|
},
|
||||||
|
"types": "index.d.ts"
|
||||||
|
}
|
||||||
+477
@@ -0,0 +1,477 @@
|
|||||||
|
This file contains the PGP keys of various developers.
|
||||||
|
Please don't use them for email unless you have to. Their main
|
||||||
|
purpose is code signing.
|
||||||
|
|
||||||
|
Examples of importing this file in your keystore:
|
||||||
|
gpg --import KEYS.txt
|
||||||
|
(need pgp and other examples here)
|
||||||
|
|
||||||
|
Examples of adding your key to this file:
|
||||||
|
pgp -kxa <your name> and append it to this file.
|
||||||
|
(pgpk -ll <your name> && pgpk -xa <your name>) >> this file.
|
||||||
|
(gpg --list-sigs <your name>
|
||||||
|
&& gpg --armor --export <your name>) >> this file.
|
||||||
|
|
||||||
|
---------------------------------------
|
||||||
|
pub rsa4096 2018-04-23 [SC]
|
||||||
|
9B06D9B4FA37C4DD52725742747985D7E3CEB635
|
||||||
|
uid [ultimate] Su Shuang (CODE SIGNING KEY) <sushuang@apache.org>
|
||||||
|
sig 3 747985D7E3CEB635 2018-04-23 Su Shuang (CODE SIGNING KEY) <sushuang@apache.org>
|
||||||
|
sub rsa4096 2018-04-23 [E]
|
||||||
|
sig 747985D7E3CEB635 2018-04-23 Su Shuang (CODE SIGNING KEY) <sushuang@apache.org>
|
||||||
|
|
||||||
|
-----BEGIN PGP PUBLIC KEY BLOCK-----
|
||||||
|
|
||||||
|
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
|
||||||
|
oQH7TsthVKvdZyjtZQg=
|
||||||
|
=Uv8d
|
||||||
|
-----END PGP PUBLIC KEY BLOCK-----
|
||||||
|
|
||||||
|
pub rsa4096 2019-01-24 [SC]
|
||||||
|
1683FBD23F6DD36C0E52223507D78F777D2C0C27
|
||||||
|
uid [ultimate] Ovilia (CODE SIGNING KEY) <oviliazhang@gmail.com>
|
||||||
|
sig 3 07D78F777D2C0C27 2019-01-24 Ovilia (CODE SIGNING KEY) <oviliazhang@gmail.com>
|
||||||
|
sub rsa4096 2019-01-24 [E]
|
||||||
|
sig 07D78F777D2C0C27 2019-01-24 Ovilia (CODE SIGNING KEY) <oviliazhang@gmail.com>
|
||||||
|
|
||||||
|
-----BEGIN PGP PUBLIC KEY BLOCK-----
|
||||||
|
|
||||||
|
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
|
||||||
|
B4WM8AJSCwl8WlZrRA==
|
||||||
|
=wft0
|
||||||
|
-----END PGP PUBLIC KEY BLOCK-----
|
||||||
|
|
||||||
|
pub rsa4096 2020-08-06 [SC]
|
||||||
|
94BD178077672157652826758E44A82497382298
|
||||||
|
uid [ 绝对 ] Shen Yi (CODE SIGNING KEY\) <shenyi@apache.org>
|
||||||
|
sig 3 8E44A82497382298 2020-08-06 Shen Yi (CODE SIGNING KEY\) <shenyi@apache.org>
|
||||||
|
sub rsa4096 2020-08-06 [E]
|
||||||
|
sig 8E44A82497382298 2020-08-06 Shen Yi (CODE SIGNING KEY\) <shenyi@apache.org>
|
||||||
|
|
||||||
|
-----BEGIN PGP PUBLIC KEY BLOCK-----
|
||||||
|
|
||||||
|
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
|
||||||
|
krvOtK7UUytDTcY=
|
||||||
|
=+SBy
|
||||||
|
-----END PGP PUBLIC KEY BLOCK-----
|
||||||
|
pub rsa4096 2022-03-02 [SC]
|
||||||
|
8ACA4FC874B6B0836DFE70BB52514D7E7CFC32B6
|
||||||
|
uid [ 绝对 ] Zhang Wenli (CODE SIGNING KEY) <ovilia@apache.org>
|
||||||
|
sig 3 52514D7E7CFC32B6 2022-03-02 Zhang Wenli (CODE SIGNING KEY) <ovilia@apache.org>
|
||||||
|
sub rsa4096 2022-03-02 [E]
|
||||||
|
sig 52514D7E7CFC32B6 2022-03-02 Zhang Wenli (CODE SIGNING KEY) <ovilia@apache.org>
|
||||||
|
|
||||||
|
-----BEGIN PGP PUBLIC KEY BLOCK-----
|
||||||
|
|
||||||
|
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
|
||||||
|
RWnk0btbWIvaznWpIWo=
|
||||||
|
=QBYg
|
||||||
|
-----END PGP PUBLIC KEY BLOCK-----
|
||||||
|
pub rsa4096 2022-03-28 [SC]
|
||||||
|
EFA5629C5F1FF8D33E016202F16C82C561221579
|
||||||
|
uid [ultimate] Zhongxiang Wang (CODE SIGNING KEY) <wangzx@apache.org>
|
||||||
|
sig 3 F16C82C561221579 2022-03-28 Zhongxiang Wang (CODE SIGNING KEY) <wangzx@apache.org>
|
||||||
|
sub rsa4096 2022-03-28 [E]
|
||||||
|
sig F16C82C561221579 2022-03-28 Zhongxiang Wang (CODE SIGNING KEY) <wangzx@apache.org>
|
||||||
|
|
||||||
|
-----BEGIN PGP PUBLIC KEY BLOCK-----
|
||||||
|
|
||||||
|
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
|
||||||
|
5B5E6LlMNPTCWmPzYtTm5qZK
|
||||||
|
=bbcU
|
||||||
|
-----END PGP PUBLIC KEY BLOCK-----
|
||||||
|
pub ed25519 2022-12-01 [SC] [expires: 2024-11-30]
|
||||||
|
016736F5612A13D1FD04AA45CC593BC1F4F4EB7A
|
||||||
|
uid [ultimate] susiwen <susiwen8@gmail.com>
|
||||||
|
sig 3 CC593BC1F4F4EB7A 2022-12-01 susiwen <susiwen8@gmail.com>
|
||||||
|
sub cv25519 2022-12-01 [E] [expires: 2024-11-30]
|
||||||
|
sig CC593BC1F4F4EB7A 2022-12-01 susiwen <susiwen8@gmail.com>
|
||||||
|
|
||||||
|
-----BEGIN PGP PUBLIC KEY BLOCK-----
|
||||||
|
|
||||||
|
mDMEY4jDBhYJKwYBBAHaRw8BAQdAlpaQNA7ARfkPVj6EoYARkkGPdLgOmulCwScl
|
||||||
|
xGk3+8m0HHN1c2l3ZW4gPHN1c2l3ZW44QGdtYWlsLmNvbT6ImQQTFgoAQRYhBAFn
|
||||||
|
NvVhKhPR/QSqRcxZO8H09Ot6BQJjiMMGAhsDBQkDwmcABQsJCAcCAiICBhUKCQgL
|
||||||
|
AgQWAgMBAh4HAheAAAoJEMxZO8H09Ot6gcoBANBsCrZOwZtWCCQB2A6cy0or7q4c
|
||||||
|
GdyMJbP7zT5tdAAuAQDI7dy5/KE5tklZmEHJZevQLWezs6yKi+31QxcNFh6FA7g4
|
||||||
|
BGOIwwYSCisGAQQBl1UBBQEBB0A4z0jb/PpPRt/zILSBzl8XidMvvQAksexms4P4
|
||||||
|
D74EcQMBCAeIfgQYFgoAJhYhBAFnNvVhKhPR/QSqRcxZO8H09Ot6BQJjiMMGAhsM
|
||||||
|
BQkDwmcAAAoJEMxZO8H09Ot6hEABALEBaZSNzmx17PbubyiyvtaEISuzsv23RYwh
|
||||||
|
4NRHP4BkAP475WSjwMns2hSairvPXULqAcqQnjytov7CU1hbMLvgDpgzBGOMr5EW
|
||||||
|
CSsGAQQB2kcPAQEHQF85ZZTr9NstXxkToCrkVYwNuahidgRyv6S3zo2xTc6ZtC9z
|
||||||
|
dXNpd2VuIChDT0RFIFNJR05JTkcgS0VZKSA8c3VzaXdlbjhAZ21haWwuY29tPoiT
|
||||||
|
BBMWCgA7FiEEhBIjSy5LUgkGNSGQJZ0/SMJTSzwFAmOMr5ECGwMFCwkIBwICIgIG
|
||||||
|
FQoJCAsCBBYCAwECHgcCF4AACgkQJZ0/SMJTSzyNaAD+P35MI4r5nUDDg97QKYNY
|
||||||
|
m99MtUxTmcK/KGsrxYEZEDEA/jECGFvy/5WAhIRUTl4ExVsY3eBL/K2DaoTseW4a
|
||||||
|
eVEPuDgEY4yvkRIKKwYBBAGXVQEFAQEHQKNPmeMoqbHBVs5xn0c+Tz/bPW0rDDbw
|
||||||
|
Gt1pqdBMdmUvAwEIB4h4BBgWCgAgFiEEhBIjSy5LUgkGNSGQJZ0/SMJTSzwFAmOM
|
||||||
|
r5ECGwwACgkQJZ0/SMJTSzxTzQD+MTFHjt7z78fdTqbbRA6isxPV84cAFQsX4cRx
|
||||||
|
PRobcbkBAIwAkq+ddEycxZTdzaELpE08h/BLcScqbOl/ME1PTZ0H
|
||||||
|
=3Tm4
|
||||||
|
-----END PGP PUBLIC KEY BLOCK-----
|
||||||
|
pub ed25519 2023-03-15 [SC] [有效至:2025-03-14]
|
||||||
|
9C8B166777DB15AD1CC0FFBF715559B9217D4E5A
|
||||||
|
uid [ 绝对 ] zakwu <123537200@qq.com>
|
||||||
|
sig 3 715559B9217D4E5A 2023-03-15 zakwu <123537200@qq.com>
|
||||||
|
sub cv25519 2023-03-15 [E] [有效至:2025-03-14]
|
||||||
|
sig 715559B9217D4E5A 2023-03-15 zakwu <123537200@qq.com>
|
||||||
|
|
||||||
|
-----BEGIN PGP PUBLIC KEY BLOCK-----
|
||||||
|
|
||||||
|
mDMEZBE+JRYJKwYBBAHaRw8BAQdA4US4FlrxvH2Ckj5NzIkeL5nd4NyDBrlpyERo
|
||||||
|
KvlXn/C0GHpha3d1IDwxMjM1MzcyMDBAcXEuY29tPoiZBBMWCgBBFiEEnIsWZ3fb
|
||||||
|
Fa0cwP+/cVVZuSF9TloFAmQRPiUCGwMFCQPCZwAFCwkIBwICIgIGFQoJCAsCBBYC
|
||||||
|
AwECHgcCF4AACgkQcVVZuSF9TloeGAD/RjarHn34jh1NtJGi6Z8wv/XWESxyNH6g
|
||||||
|
orBPlQ+yluEBAIinhY8j/XczJQUcj9cqpMB4m8R+/jEadbaBe9pQ3uAHuDgEZBE+
|
||||||
|
JRIKKwYBBAGXVQEFAQEHQPa8rnpAhbsWw0VsCbYo1J+VeZXT/piqPpdducN3Wyh2
|
||||||
|
AwEIB4h+BBgWCgAmFiEEnIsWZ3fbFa0cwP+/cVVZuSF9TloFAmQRPiUCGwwFCQPC
|
||||||
|
ZwAACgkQcVVZuSF9Tlrc4QD/ZDd7OjcT9ShdARjcGoQ0jt6rEqL6n10V6caG+77a
|
||||||
|
89wA/R+29UlbOXNAxcQHxph8WXUZhACDhKyNETgRsgHysZQJ
|
||||||
|
=/6bg
|
||||||
|
-----END PGP PUBLIC KEY BLOCK-----
|
||||||
|
pub rsa4096 2024-01-31 [SC]
|
||||||
|
88AF48720040B150083A7D10932517D290673A7B
|
||||||
|
uid [ 绝对 ] Zhang Wenli <ovilia@apache.org>
|
||||||
|
sig 3 932517D290673A7B 2024-01-31 [自签名]
|
||||||
|
sub rsa4096 2024-01-31 [E]
|
||||||
|
sig 932517D290673A7B 2024-01-31 [自签名]
|
||||||
|
|
||||||
|
-----BEGIN PGP PUBLIC KEY BLOCK-----
|
||||||
|
|
||||||
|
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
|
||||||
|
=YTwy
|
||||||
|
-----END PGP PUBLIC KEY BLOCK-----
|
||||||
|
pub rsa4096 2025-06-23 [SC]
|
||||||
|
2596934C69DD1F4E677C6C9EE724480BC0986082
|
||||||
|
uid [ultimate] Ovilia <ovilia@apache.org>
|
||||||
|
sig 3 E724480BC0986082 2025-06-23 [self-signature]
|
||||||
|
sub rsa4096 2025-06-23 [E]
|
||||||
|
sig E724480BC0986082 2025-06-23 [self-signature]
|
||||||
|
|
||||||
|
-----BEGIN PGP PUBLIC KEY BLOCK-----
|
||||||
|
|
||||||
|
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
|
||||||
|
=ghQF
|
||||||
|
-----END PGP PUBLIC KEY BLOCK-----
|
||||||
+222
@@ -0,0 +1,222 @@
|
|||||||
|
|
||||||
|
Apache License
|
||||||
|
Version 2.0, January 2004
|
||||||
|
http://www.apache.org/licenses/
|
||||||
|
|
||||||
|
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||||
|
|
||||||
|
1. Definitions.
|
||||||
|
|
||||||
|
"License" shall mean the terms and conditions for use, reproduction,
|
||||||
|
and distribution as defined by Sections 1 through 9 of this document.
|
||||||
|
|
||||||
|
"Licensor" shall mean the copyright owner or entity authorized by
|
||||||
|
the copyright owner that is granting the License.
|
||||||
|
|
||||||
|
"Legal Entity" shall mean the union of the acting entity and all
|
||||||
|
other entities that control, are controlled by, or are under common
|
||||||
|
control with that entity. For the purposes of this definition,
|
||||||
|
"control" means (i) the power, direct or indirect, to cause the
|
||||||
|
direction or management of such entity, whether by contract or
|
||||||
|
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||||
|
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||||
|
|
||||||
|
"You" (or "Your") shall mean an individual or Legal Entity
|
||||||
|
exercising permissions granted by this License.
|
||||||
|
|
||||||
|
"Source" form shall mean the preferred form for making modifications,
|
||||||
|
including but not limited to software source code, documentation
|
||||||
|
source, and configuration files.
|
||||||
|
|
||||||
|
"Object" form shall mean any form resulting from mechanical
|
||||||
|
transformation or translation of a Source form, including but
|
||||||
|
not limited to compiled object code, generated documentation,
|
||||||
|
and conversions to other media types.
|
||||||
|
|
||||||
|
"Work" shall mean the work of authorship, whether in Source or
|
||||||
|
Object form, made available under the License, as indicated by a
|
||||||
|
copyright notice that is included in or attached to the work
|
||||||
|
(an example is provided in the Appendix below).
|
||||||
|
|
||||||
|
"Derivative Works" shall mean any work, whether in Source or Object
|
||||||
|
form, that is based on (or derived from) the Work and for which the
|
||||||
|
editorial revisions, annotations, elaborations, or other modifications
|
||||||
|
represent, as a whole, an original work of authorship. For the purposes
|
||||||
|
of this License, Derivative Works shall not include works that remain
|
||||||
|
separable from, or merely link (or bind by name) to the interfaces of,
|
||||||
|
the Work and Derivative Works thereof.
|
||||||
|
|
||||||
|
"Contribution" shall mean any work of authorship, including
|
||||||
|
the original version of the Work and any modifications or additions
|
||||||
|
to that Work or Derivative Works thereof, that is intentionally
|
||||||
|
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||||
|
or by an individual or Legal Entity authorized to submit on behalf of
|
||||||
|
the copyright owner. For the purposes of this definition, "submitted"
|
||||||
|
means any form of electronic, verbal, or written communication sent
|
||||||
|
to the Licensor or its representatives, including but not limited to
|
||||||
|
communication on electronic mailing lists, source code control systems,
|
||||||
|
and issue tracking systems that are managed by, or on behalf of, the
|
||||||
|
Licensor for the purpose of discussing and improving the Work, but
|
||||||
|
excluding communication that is conspicuously marked or otherwise
|
||||||
|
designated in writing by the copyright owner as "Not a Contribution."
|
||||||
|
|
||||||
|
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||||
|
on behalf of whom a Contribution has been received by Licensor and
|
||||||
|
subsequently incorporated within the Work.
|
||||||
|
|
||||||
|
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||||
|
this License, each Contributor hereby grants to You a perpetual,
|
||||||
|
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||||
|
copyright license to reproduce, prepare Derivative Works of,
|
||||||
|
publicly display, publicly perform, sublicense, and distribute the
|
||||||
|
Work and such Derivative Works in Source or Object form.
|
||||||
|
|
||||||
|
3. Grant of Patent License. Subject to the terms and conditions of
|
||||||
|
this License, each Contributor hereby grants to You a perpetual,
|
||||||
|
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||||
|
(except as stated in this section) patent license to make, have made,
|
||||||
|
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||||
|
where such license applies only to those patent claims licensable
|
||||||
|
by such Contributor that are necessarily infringed by their
|
||||||
|
Contribution(s) alone or by combination of their Contribution(s)
|
||||||
|
with the Work to which such Contribution(s) was submitted. If You
|
||||||
|
institute patent litigation against any entity (including a
|
||||||
|
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||||
|
or a Contribution incorporated within the Work constitutes direct
|
||||||
|
or contributory patent infringement, then any patent licenses
|
||||||
|
granted to You under this License for that Work shall terminate
|
||||||
|
as of the date such litigation is filed.
|
||||||
|
|
||||||
|
4. Redistribution. You may reproduce and distribute copies of the
|
||||||
|
Work or Derivative Works thereof in any medium, with or without
|
||||||
|
modifications, and in Source or Object form, provided that You
|
||||||
|
meet the following conditions:
|
||||||
|
|
||||||
|
(a) You must give any other recipients of the Work or
|
||||||
|
Derivative Works a copy of this License; and
|
||||||
|
|
||||||
|
(b) You must cause any modified files to carry prominent notices
|
||||||
|
stating that You changed the files; and
|
||||||
|
|
||||||
|
(c) You must retain, in the Source form of any Derivative Works
|
||||||
|
that You distribute, all copyright, patent, trademark, and
|
||||||
|
attribution notices from the Source form of the Work,
|
||||||
|
excluding those notices that do not pertain to any part of
|
||||||
|
the Derivative Works; and
|
||||||
|
|
||||||
|
(d) If the Work includes a "NOTICE" text file as part of its
|
||||||
|
distribution, then any Derivative Works that You distribute must
|
||||||
|
include a readable copy of the attribution notices contained
|
||||||
|
within such NOTICE file, excluding those notices that do not
|
||||||
|
pertain to any part of the Derivative Works, in at least one
|
||||||
|
of the following places: within a NOTICE text file distributed
|
||||||
|
as part of the Derivative Works; within the Source form or
|
||||||
|
documentation, if provided along with the Derivative Works; or,
|
||||||
|
within a display generated by the Derivative Works, if and
|
||||||
|
wherever such third-party notices normally appear. The contents
|
||||||
|
of the NOTICE file are for informational purposes only and
|
||||||
|
do not modify the License. You may add Your own attribution
|
||||||
|
notices within Derivative Works that You distribute, alongside
|
||||||
|
or as an addendum to the NOTICE text from the Work, provided
|
||||||
|
that such additional attribution notices cannot be construed
|
||||||
|
as modifying the License.
|
||||||
|
|
||||||
|
You may add Your own copyright statement to Your modifications and
|
||||||
|
may provide additional or different license terms and conditions
|
||||||
|
for use, reproduction, or distribution of Your modifications, or
|
||||||
|
for any such Derivative Works as a whole, provided Your use,
|
||||||
|
reproduction, and distribution of the Work otherwise complies with
|
||||||
|
the conditions stated in this License.
|
||||||
|
|
||||||
|
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||||
|
any Contribution intentionally submitted for inclusion in the Work
|
||||||
|
by You to the Licensor shall be under the terms and conditions of
|
||||||
|
this License, without any additional terms or conditions.
|
||||||
|
Notwithstanding the above, nothing herein shall supersede or modify
|
||||||
|
the terms of any separate license agreement you may have executed
|
||||||
|
with Licensor regarding such Contributions.
|
||||||
|
|
||||||
|
6. Trademarks. This License does not grant permission to use the trade
|
||||||
|
names, trademarks, service marks, or product names of the Licensor,
|
||||||
|
except as required for reasonable and customary use in describing the
|
||||||
|
origin of the Work and reproducing the content of the NOTICE file.
|
||||||
|
|
||||||
|
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||||
|
agreed to in writing, Licensor provides the Work (and each
|
||||||
|
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||||
|
implied, including, without limitation, any warranties or conditions
|
||||||
|
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||||
|
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||||
|
appropriateness of using or redistributing the Work and assume any
|
||||||
|
risks associated with Your exercise of permissions under this License.
|
||||||
|
|
||||||
|
8. Limitation of Liability. In no event and under no legal theory,
|
||||||
|
whether in tort (including negligence), contract, or otherwise,
|
||||||
|
unless required by applicable law (such as deliberate and grossly
|
||||||
|
negligent acts) or agreed to in writing, shall any Contributor be
|
||||||
|
liable to You for damages, including any direct, indirect, special,
|
||||||
|
incidental, or consequential damages of any character arising as a
|
||||||
|
result of this License or out of the use or inability to use the
|
||||||
|
Work (including but not limited to damages for loss of goodwill,
|
||||||
|
work stoppage, computer failure or malfunction, or any and all
|
||||||
|
other commercial damages or losses), even if such Contributor
|
||||||
|
has been advised of the possibility of such damages.
|
||||||
|
|
||||||
|
9. Accepting Warranty or Additional Liability. While redistributing
|
||||||
|
the Work or Derivative Works thereof, You may choose to offer,
|
||||||
|
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||||
|
or other liability obligations and/or rights consistent with this
|
||||||
|
License. However, in accepting such obligations, You may act only
|
||||||
|
on Your own behalf and on Your sole responsibility, not on behalf
|
||||||
|
of any other Contributor, and only if You agree to indemnify,
|
||||||
|
defend, and hold each Contributor harmless for any liability
|
||||||
|
incurred by, or claims asserted against, such Contributor by reason
|
||||||
|
of your accepting any such warranty or additional liability.
|
||||||
|
|
||||||
|
END OF TERMS AND CONDITIONS
|
||||||
|
|
||||||
|
APPENDIX: How to apply the Apache License to your work.
|
||||||
|
|
||||||
|
To apply the Apache License to your work, attach the following
|
||||||
|
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||||
|
replaced with your own identifying information. (Don't include
|
||||||
|
the brackets!) The text should be enclosed in the appropriate
|
||||||
|
comment syntax for the file format. We also recommend that a
|
||||||
|
file or class name and description of purpose be included on the
|
||||||
|
same "printed page" as the copyright notice for easier
|
||||||
|
identification within third-party archives.
|
||||||
|
|
||||||
|
Copyright [yyyy] [name of copyright owner]
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
========================================================================
|
||||||
|
Apache ECharts Subcomponents:
|
||||||
|
|
||||||
|
The Apache ECharts project contains subcomponents with separate copyright
|
||||||
|
notices and license terms. Your use of the source code for these
|
||||||
|
subcomponents is also subject to the terms and conditions of the following
|
||||||
|
licenses.
|
||||||
|
|
||||||
|
BSD 3-Clause (d3.js):
|
||||||
|
The following files embed [d3.js](https://github.com/d3/d3) BSD 3-Clause:
|
||||||
|
`/src/chart/treemap/treemapLayout.ts`,
|
||||||
|
`/src/chart/tree/layoutHelper.ts`,
|
||||||
|
`/src/chart/graph/forceHelper.ts`,
|
||||||
|
`/src/util/number.ts`
|
||||||
|
See `/licenses/LICENSE-d3` for details of the license.
|
||||||
+5
@@ -0,0 +1,5 @@
|
|||||||
|
Apache ECharts
|
||||||
|
Copyright 2017-2026 The Apache Software Foundation
|
||||||
|
|
||||||
|
This product includes software developed at
|
||||||
|
The Apache Software Foundation (https://www.apache.org/).
|
||||||
+98
@@ -0,0 +1,98 @@
|
|||||||
|
# Apache ECharts
|
||||||
|
|
||||||
|
<a href="https://echarts.apache.org/">
|
||||||
|
<img style="vertical-align: top;" src="./asset/logo.png?raw=true" alt="logo" height="50px">
|
||||||
|
</a>
|
||||||
|
|
||||||
|
Apache ECharts is a free, powerful charting and visualization library offering easy ways to add intuitive, interactive, and highly customizable charts to your commercial products. It is written in pure JavaScript and based on <a href="https://github.com/ecomfe/zrender">zrender</a>, which is a whole new lightweight canvas library.
|
||||||
|
|
||||||
|
**[中文官网](https://echarts.apache.org/zh/index.html)** | **[ENGLISH HOMEPAGE](https://echarts.apache.org/en/index.html)**
|
||||||
|
|
||||||
|
[](https://github.com/apache/echarts/blob/master/LICENSE) [](https://www.npmjs.com/package/echarts) [](https://www.npmjs.com/package/echarts) [](https://github.com/apache/echarts/graphs/contributors)
|
||||||
|
|
||||||
|
[](https://github.com/apache/echarts/actions/workflows/ci.yml)
|
||||||
|
|
||||||
|
## Get Apache ECharts
|
||||||
|
|
||||||
|
You may choose one of the following methods:
|
||||||
|
|
||||||
|
+ Download from the [official website](https://echarts.apache.org/download.html)
|
||||||
|
+ `npm install echarts --save`
|
||||||
|
+ CDN: [jsDelivr CDN](https://www.jsdelivr.com/package/npm/echarts?path=dist)
|
||||||
|
|
||||||
|
## Docs
|
||||||
|
|
||||||
|
+ [Get Started](https://echarts.apache.org/handbook)
|
||||||
|
+ [API](https://echarts.apache.org/api.html)
|
||||||
|
+ [Option Manual](https://echarts.apache.org/option.html)
|
||||||
|
+ [Examples](https://echarts.apache.org/examples)
|
||||||
|
|
||||||
|
## Get Help
|
||||||
|
|
||||||
|
+ [GitHub Issues](https://github.com/apache/echarts/issues) for bug report and feature requests
|
||||||
|
+ Email [dev@echarts.apache.org](mailto:dev@echarts.apache.org) for general questions
|
||||||
|
+ Subscribe to the [mailing list](https://echarts.apache.org/maillist.html) to get updated with the project
|
||||||
|
|
||||||
|
## Build
|
||||||
|
|
||||||
|
Build echarts source code:
|
||||||
|
|
||||||
|
Execute the instructions in the root directory of the echarts:
|
||||||
|
([Node.js](https://nodejs.org) is required)
|
||||||
|
|
||||||
|
```shell
|
||||||
|
# Install the dependencies from NPM:
|
||||||
|
npm install
|
||||||
|
|
||||||
|
# Rebuild source code immediately in watch mode when changing the source code.
|
||||||
|
# It opens the `./test` directory, and you may open `-cases.html` to get the list
|
||||||
|
# of all test cases.
|
||||||
|
# If you wish to create a test case, run `npm run mktest:help` to learn more.
|
||||||
|
npm run dev
|
||||||
|
|
||||||
|
# Check the correctness of TypeScript code.
|
||||||
|
npm run checktype
|
||||||
|
|
||||||
|
# If intending to build and get all types of the "production" files:
|
||||||
|
npm run release
|
||||||
|
```
|
||||||
|
|
||||||
|
Then the "production" files are generated in the `dist` directory.
|
||||||
|
|
||||||
|
## Contribution
|
||||||
|
|
||||||
|
Please refer to the [contributing](https://github.com/apache/echarts/blob/master/CONTRIBUTING.md) document if you wish to debug locally or make pull requests.
|
||||||
|
|
||||||
|
## Resources
|
||||||
|
|
||||||
|
### Awesome ECharts
|
||||||
|
|
||||||
|
[https://github.com/ecomfe/awesome-echarts](https://github.com/ecomfe/awesome-echarts)
|
||||||
|
|
||||||
|
### Extensions
|
||||||
|
|
||||||
|
+ [ECharts GL](https://github.com/ecomfe/echarts-gl) An extension pack of ECharts, which provides 3D plots, globe visualization, and WebGL acceleration.
|
||||||
|
|
||||||
|
+ [Liquidfill 水球图](https://github.com/ecomfe/echarts-liquidfill)
|
||||||
|
|
||||||
|
+ [Wordcloud 字符云](https://github.com/ecomfe/echarts-wordcloud)
|
||||||
|
|
||||||
|
+ [Extension for Baidu Map 百度地图扩展](https://github.com/apache/echarts/tree/master/extension-src/bmap) An extension provides a wrapper of Baidu Map Service SDK.
|
||||||
|
|
||||||
|
+ [vue-echarts](https://github.com/ecomfe/vue-echarts) ECharts component for Vue.js
|
||||||
|
|
||||||
|
+ [echarts-stat](https://github.com/ecomfe/echarts-stat) Statistics tool for ECharts
|
||||||
|
|
||||||
|
## License
|
||||||
|
|
||||||
|
ECharts is available under the Apache License V2.
|
||||||
|
|
||||||
|
## Code of Conduct
|
||||||
|
|
||||||
|
Please refer to [Apache Code of Conduct](https://www.apache.org/foundation/policies/conduct.html).
|
||||||
|
|
||||||
|
## Paper
|
||||||
|
|
||||||
|
Deqing Li, Honghui Mei, Yi Shen, Shuang Su, Wenli Zhang, Junting Wang, Ming Zu, Wei Chen.
|
||||||
|
[ECharts: A Declarative Framework for Rapid Construction of Web-based Visualization](https://www.sciencedirect.com/science/article/pii/S2468502X18300068).
|
||||||
|
Visual Informatics, 2018.
|
||||||
BIN
Binary file not shown.
|
After Width: | Height: | Size: 7.2 KiB |
+22
@@ -0,0 +1,22 @@
|
|||||||
|
/*
|
||||||
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
* distributed with this work for additional information
|
||||||
|
* regarding copyright ownership. The ASF licenses this file
|
||||||
|
* to you under the Apache License, Version 2.0 (the
|
||||||
|
* "License"); you may not use this file except in compliance
|
||||||
|
* with the License. You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing,
|
||||||
|
* software distributed under the License is distributed on an
|
||||||
|
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||||
|
* KIND, either express or implied. See the License for the
|
||||||
|
* specific language governing permissions and limitations
|
||||||
|
* under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
// A pseudo `.js` to redirect to `.d.ts`.
|
||||||
|
export * from './types/dist/charts.js';
|
||||||
|
// See section "TypeScript entries" in `echarts/package.README.md` for more details.
|
||||||
+27
@@ -0,0 +1,27 @@
|
|||||||
|
/*
|
||||||
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
* distributed with this work for additional information
|
||||||
|
* regarding copyright ownership. The ASF licenses this file
|
||||||
|
* to you under the Apache License, Version 2.0 (the
|
||||||
|
* "License"); you may not use this file except in compliance
|
||||||
|
* with the License. You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing,
|
||||||
|
* software distributed under the License is distributed on an
|
||||||
|
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||||
|
* KIND, either express or implied. See the License for the
|
||||||
|
* specific language governing permissions and limitations
|
||||||
|
* under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
// In somehow. If we export like
|
||||||
|
// export * as LineChart './chart/line/install'
|
||||||
|
// The exported code will be transformed to
|
||||||
|
// import * as LineChart_1 './chart/line/install'; export {LineChart_1 as LineChart};
|
||||||
|
// Treeshaking in webpack will not work even if we configured sideEffects to false in package.json
|
||||||
|
|
||||||
|
export * from './lib/export/charts.js';
|
||||||
+22
@@ -0,0 +1,22 @@
|
|||||||
|
/*
|
||||||
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
* distributed with this work for additional information
|
||||||
|
* regarding copyright ownership. The ASF licenses this file
|
||||||
|
* to you under the Apache License, Version 2.0 (the
|
||||||
|
* "License"); you may not use this file except in compliance
|
||||||
|
* with the License. You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing,
|
||||||
|
* software distributed under the License is distributed on an
|
||||||
|
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||||
|
* KIND, either express or implied. See the License for the
|
||||||
|
* specific language governing permissions and limitations
|
||||||
|
* under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
// A pseudo `.js` to redirect to `.d.ts`.
|
||||||
|
export * from './types/dist/components.js';
|
||||||
|
// See section "TypeScript entries" in `echarts/package.README.md` for more details.
|
||||||
+20
@@ -0,0 +1,20 @@
|
|||||||
|
/*
|
||||||
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
* distributed with this work for additional information
|
||||||
|
* regarding copyright ownership. The ASF licenses this file
|
||||||
|
* to you under the Apache License, Version 2.0 (the
|
||||||
|
* "License"); you may not use this file except in compliance
|
||||||
|
* with the License. You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing,
|
||||||
|
* software distributed under the License is distributed on an
|
||||||
|
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||||
|
* KIND, either express or implied. See the License for the
|
||||||
|
* specific language governing permissions and limitations
|
||||||
|
* under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
export * from './lib/export/components.js';
|
||||||
+22
@@ -0,0 +1,22 @@
|
|||||||
|
/*
|
||||||
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
* distributed with this work for additional information
|
||||||
|
* regarding copyright ownership. The ASF licenses this file
|
||||||
|
* to you under the Apache License, Version 2.0 (the
|
||||||
|
* "License"); you may not use this file except in compliance
|
||||||
|
* with the License. You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing,
|
||||||
|
* software distributed under the License is distributed on an
|
||||||
|
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||||
|
* KIND, either express or implied. See the License for the
|
||||||
|
* specific language governing permissions and limitations
|
||||||
|
* under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
// A pseudo `.js` to redirect to `.d.ts`.
|
||||||
|
export * from './types/dist/core.js';
|
||||||
|
// See section "TypeScript entries" in `echarts/package.README.md` for more details.
|
||||||
+20
@@ -0,0 +1,20 @@
|
|||||||
|
/*
|
||||||
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
* distributed with this work for additional information
|
||||||
|
* regarding copyright ownership. The ASF licenses this file
|
||||||
|
* to you under the Apache License, Version 2.0 (the
|
||||||
|
* "License"); you may not use this file except in compliance
|
||||||
|
* with the License. You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing,
|
||||||
|
* software distributed under the License is distributed on an
|
||||||
|
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||||
|
* KIND, either express or implied. See the License for the
|
||||||
|
* specific language governing permissions and limitations
|
||||||
|
* under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
export * from './lib/export/core.js';
|
||||||
+63108
File diff suppressed because it is too large
Load Diff
+1
File diff suppressed because one or more lines are too long
+45
File diff suppressed because one or more lines are too long
+95776
File diff suppressed because it is too large
Load Diff
+1
File diff suppressed because one or more lines are too long
+45
File diff suppressed because one or more lines are too long
+45
File diff suppressed because one or more lines are too long
+95776
File diff suppressed because it is too large
Load Diff
+1
File diff suppressed because one or more lines are too long
+95843
File diff suppressed because it is too large
Load Diff
+1
File diff suppressed because one or more lines are too long
+45
File diff suppressed because one or more lines are too long
+46053
File diff suppressed because it is too large
Load Diff
+1
File diff suppressed because one or more lines are too long
+45
File diff suppressed because one or more lines are too long
+386
@@ -0,0 +1,386 @@
|
|||||||
|
|
||||||
|
/*
|
||||||
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
* distributed with this work for additional information
|
||||||
|
* regarding copyright ownership. The ASF licenses this file
|
||||||
|
* to you under the Apache License, Version 2.0 (the
|
||||||
|
* "License"); you may not use this file except in compliance
|
||||||
|
* with the License. You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing,
|
||||||
|
* software distributed under the License is distributed on an
|
||||||
|
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||||
|
* KIND, either express or implied. See the License for the
|
||||||
|
* specific language governing permissions and limitations
|
||||||
|
* under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
(function (global, factory) {
|
||||||
|
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('echarts')) :
|
||||||
|
typeof define === 'function' && define.amd ? define(['exports', 'echarts'], factory) :
|
||||||
|
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.bmap = {}, global.echarts));
|
||||||
|
}(this, (function (exports, echarts) { 'use strict';
|
||||||
|
|
||||||
|
function v2Equal(a, b) {
|
||||||
|
return a && b && a[0] === b[0] && a[1] === b[1];
|
||||||
|
}
|
||||||
|
var COMPONENT_MAIN_TYPE_BMAP = 'bmap';
|
||||||
|
var proto = {
|
||||||
|
type: COMPONENT_MAIN_TYPE_BMAP,
|
||||||
|
__bmap: undefined,
|
||||||
|
__mapOffset: undefined,
|
||||||
|
__mapStyle: undefined,
|
||||||
|
__mapStyle2: undefined,
|
||||||
|
coordinateSystem: undefined,
|
||||||
|
getBMap: function () {
|
||||||
|
// __bmap is injected when creating BMapCoordSys
|
||||||
|
return this.__bmap;
|
||||||
|
},
|
||||||
|
setCenterAndZoom: function (center, zoom) {
|
||||||
|
this.option.center = center;
|
||||||
|
this.option.zoom = zoom;
|
||||||
|
},
|
||||||
|
centerOrZoomChanged: function (center, zoom) {
|
||||||
|
var option = this.option;
|
||||||
|
return !(v2Equal(center, option.center) && zoom === option.zoom);
|
||||||
|
},
|
||||||
|
defaultOption: {
|
||||||
|
center: [104.114129, 37.550339],
|
||||||
|
zoom: 5,
|
||||||
|
// 2.0 https://lbsyun.baidu.com/custom/index.htm
|
||||||
|
mapStyle: {},
|
||||||
|
// 3.0 https://lbsyun.baidu.com/index.php?title=open/custom
|
||||||
|
mapStyleV2: {},
|
||||||
|
// See https://lbsyun.baidu.com/cms/jsapi/reference/jsapi_reference.html#a0b1
|
||||||
|
mapOptions: {},
|
||||||
|
roam: false
|
||||||
|
}
|
||||||
|
};
|
||||||
|
echarts.extendComponentModel(proto);
|
||||||
|
|
||||||
|
var COORD_SYS_BMAP = COMPONENT_MAIN_TYPE_BMAP;
|
||||||
|
function makeDimensions() {
|
||||||
|
return ['lng', 'lat'];
|
||||||
|
}
|
||||||
|
var BMapCoordSys = /** @class */function () {
|
||||||
|
function BMapCoordSys(bmap, api) {
|
||||||
|
this.dimensions = makeDimensions();
|
||||||
|
this.type = COORD_SYS_BMAP;
|
||||||
|
this._mapOffset = [0, 0];
|
||||||
|
this._projection = new BMap.MercatorProjection();
|
||||||
|
this._bmap = bmap;
|
||||||
|
this._api = api;
|
||||||
|
}
|
||||||
|
BMapCoordSys.prototype.setZoom = function (zoom) {
|
||||||
|
this._zoom = zoom;
|
||||||
|
};
|
||||||
|
BMapCoordSys.prototype.setCenter = function (center) {
|
||||||
|
this._center = this._projection.lngLatToPoint(new BMap.Point(center[0], center[1]));
|
||||||
|
};
|
||||||
|
BMapCoordSys.prototype.setMapOffset = function (mapOffset) {
|
||||||
|
this._mapOffset = mapOffset;
|
||||||
|
};
|
||||||
|
BMapCoordSys.prototype.getBMap = function () {
|
||||||
|
return this._bmap;
|
||||||
|
};
|
||||||
|
BMapCoordSys.prototype.dataToPoint = function (data) {
|
||||||
|
var point = new BMap.Point(data[0], data[1]);
|
||||||
|
// TODO mercator projection is toooooooo slow
|
||||||
|
// let mercatorPoint = this._projection.lngLatToPoint(point);
|
||||||
|
// let width = this._api.getZr().getWidth();
|
||||||
|
// let height = this._api.getZr().getHeight();
|
||||||
|
// let divider = Math.pow(2, 18 - 10);
|
||||||
|
// return [
|
||||||
|
// Math.round((mercatorPoint.x - this._center.x) / divider + width / 2),
|
||||||
|
// Math.round((this._center.y - mercatorPoint.y) / divider + height / 2)
|
||||||
|
// ];
|
||||||
|
var px = this._bmap.pointToOverlayPixel(point);
|
||||||
|
var mapOffset = this._mapOffset;
|
||||||
|
return [px.x - mapOffset[0], px.y - mapOffset[1]];
|
||||||
|
};
|
||||||
|
BMapCoordSys.prototype.pointToData = function (point) {
|
||||||
|
var mapOffset = this._mapOffset;
|
||||||
|
var pt = this._bmap.overlayPixelToPoint({
|
||||||
|
x: point[0] + mapOffset[0],
|
||||||
|
y: point[1] + mapOffset[1]
|
||||||
|
});
|
||||||
|
return [pt.lng, pt.lat];
|
||||||
|
};
|
||||||
|
BMapCoordSys.prototype.containPoint = function (point) {
|
||||||
|
// Currently, bmap takes the entire canvas.
|
||||||
|
return true;
|
||||||
|
};
|
||||||
|
BMapCoordSys.prototype.getViewRect = function () {
|
||||||
|
var api = this._api;
|
||||||
|
return new echarts.graphic.BoundingRect(0, 0, api.getWidth(), api.getHeight());
|
||||||
|
};
|
||||||
|
BMapCoordSys.prototype.getRoamTransform = function () {
|
||||||
|
return echarts.matrix.create();
|
||||||
|
};
|
||||||
|
BMapCoordSys.prototype.prepareCustoms = function () {
|
||||||
|
var rect = this.getViewRect();
|
||||||
|
return {
|
||||||
|
coordSys: {
|
||||||
|
// The name exposed to user is always 'cartesian2d' but not 'grid'.
|
||||||
|
type: COORD_SYS_BMAP,
|
||||||
|
x: rect.x,
|
||||||
|
y: rect.y,
|
||||||
|
width: rect.width,
|
||||||
|
height: rect.height
|
||||||
|
},
|
||||||
|
api: {
|
||||||
|
coord: echarts.util.bind(this.dataToPoint, this),
|
||||||
|
size: echarts.util.bind(dataToCoordSize, this)
|
||||||
|
}
|
||||||
|
};
|
||||||
|
};
|
||||||
|
BMapCoordSys.prototype.convertToPixel = function (ecModel, finder, value) {
|
||||||
|
// here we ignore finder as only one bmap component is allowed
|
||||||
|
return this.dataToPoint(value);
|
||||||
|
};
|
||||||
|
BMapCoordSys.prototype.convertFromPixel = function (ecModel, finder, value) {
|
||||||
|
return this.pointToData(value);
|
||||||
|
};
|
||||||
|
// For deciding which dimensions to use when creating list data
|
||||||
|
BMapCoordSys.dimensions = makeDimensions();
|
||||||
|
return BMapCoordSys;
|
||||||
|
}();
|
||||||
|
BMapCoordSys.prototype.dimensions = makeDimensions(); // For backward compatibility.
|
||||||
|
function dataToCoordSize(dataSize, dataItem) {
|
||||||
|
dataItem = dataItem || [0, 0];
|
||||||
|
return echarts.util.map([0, 1], function (dimIdx) {
|
||||||
|
var val = dataItem[dimIdx];
|
||||||
|
var halfSize = dataSize[dimIdx] / 2;
|
||||||
|
var p1 = [];
|
||||||
|
var p2 = [];
|
||||||
|
p1[dimIdx] = val - halfSize;
|
||||||
|
p2[dimIdx] = val + halfSize;
|
||||||
|
p1[1 - dimIdx] = p2[1 - dimIdx] = dataItem[1 - dimIdx];
|
||||||
|
return Math.abs(this.dataToPoint(p1)[dimIdx] - this.dataToPoint(p2)[dimIdx]);
|
||||||
|
}, this);
|
||||||
|
}
|
||||||
|
var Overlay;
|
||||||
|
function createOverlayCtor() {
|
||||||
|
function Overlay(root) {
|
||||||
|
this._root = root;
|
||||||
|
}
|
||||||
|
Overlay.prototype = new BMap.Overlay();
|
||||||
|
/**
|
||||||
|
* @override
|
||||||
|
*/
|
||||||
|
Overlay.prototype.initialize = function (map) {
|
||||||
|
map.getPanes().labelPane.appendChild(this._root);
|
||||||
|
return this._root;
|
||||||
|
};
|
||||||
|
/**
|
||||||
|
* @override
|
||||||
|
*/
|
||||||
|
Overlay.prototype.draw = function () {};
|
||||||
|
return Overlay;
|
||||||
|
}
|
||||||
|
BMapCoordSys.create = function (ecModel, api) {
|
||||||
|
var bmapCoordSys;
|
||||||
|
var root = api.getDom();
|
||||||
|
// TODO Dispose
|
||||||
|
ecModel.eachComponent(COMPONENT_MAIN_TYPE_BMAP, function (bmapModel) {
|
||||||
|
var painter = api.getZr().painter;
|
||||||
|
var viewportRoot = painter.getViewportRoot();
|
||||||
|
if (typeof BMap === 'undefined') {
|
||||||
|
throw new Error('BMap api is not loaded');
|
||||||
|
}
|
||||||
|
Overlay = Overlay || createOverlayCtor();
|
||||||
|
if (bmapCoordSys) {
|
||||||
|
throw new Error('Only one bmap component can exist');
|
||||||
|
}
|
||||||
|
var bmap;
|
||||||
|
if (!bmapModel.__bmap) {
|
||||||
|
// Not support IE8
|
||||||
|
var bmapRoot = root.querySelector('.ec-extension-bmap');
|
||||||
|
if (bmapRoot) {
|
||||||
|
// Reset viewport left and top, which will be changed
|
||||||
|
// in moving handler in BMapView
|
||||||
|
viewportRoot.style.left = '0px';
|
||||||
|
viewportRoot.style.top = '0px';
|
||||||
|
root.removeChild(bmapRoot);
|
||||||
|
}
|
||||||
|
bmapRoot = document.createElement('div');
|
||||||
|
bmapRoot.className = 'ec-extension-bmap';
|
||||||
|
// fix #13424
|
||||||
|
bmapRoot.style.cssText = 'position:absolute;width:100%;height:100%';
|
||||||
|
root.appendChild(bmapRoot);
|
||||||
|
// initializes bmap
|
||||||
|
var mapOptions = bmapModel.get('mapOptions');
|
||||||
|
if (mapOptions) {
|
||||||
|
mapOptions = echarts.util.clone(mapOptions);
|
||||||
|
// Not support `mapType`, use `bmap.setMapType(MapType)` instead.
|
||||||
|
delete mapOptions.mapType;
|
||||||
|
}
|
||||||
|
bmap = bmapModel.__bmap = new BMap.Map(bmapRoot, mapOptions);
|
||||||
|
var overlay = new Overlay(viewportRoot);
|
||||||
|
bmap.addOverlay(overlay);
|
||||||
|
// Override
|
||||||
|
painter.getViewportRootOffset = function () {
|
||||||
|
return {
|
||||||
|
offsetLeft: 0,
|
||||||
|
offsetTop: 0
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
bmap = bmapModel.__bmap;
|
||||||
|
// Set bmap options
|
||||||
|
// centerAndZoom before layout and render
|
||||||
|
var center = bmapModel.get('center');
|
||||||
|
var zoom = bmapModel.get('zoom');
|
||||||
|
if (center && zoom) {
|
||||||
|
var bmapCenter = bmap.getCenter();
|
||||||
|
var bmapZoom = bmap.getZoom();
|
||||||
|
var centerOrZoomChanged = bmapModel.centerOrZoomChanged([bmapCenter.lng, bmapCenter.lat], bmapZoom);
|
||||||
|
if (centerOrZoomChanged) {
|
||||||
|
var pt = new BMap.Point(center[0], center[1]);
|
||||||
|
bmap.centerAndZoom(pt, zoom);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
bmapCoordSys = new BMapCoordSys(bmap, api);
|
||||||
|
bmapCoordSys.setMapOffset(bmapModel.__mapOffset || [0, 0]);
|
||||||
|
bmapCoordSys.setZoom(zoom);
|
||||||
|
bmapCoordSys.setCenter(center);
|
||||||
|
bmapModel.coordinateSystem = bmapCoordSys;
|
||||||
|
});
|
||||||
|
ecModel.eachSeries(function (seriesModel) {
|
||||||
|
if (seriesModel.get('coordinateSystem') === COORD_SYS_BMAP) {
|
||||||
|
seriesModel.coordinateSystem = bmapCoordSys;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
// return created coordinate systems
|
||||||
|
return bmapCoordSys && [bmapCoordSys];
|
||||||
|
};
|
||||||
|
echarts.registerCoordinateSystem('bmap', BMapCoordSys);
|
||||||
|
|
||||||
|
function isEmptyObject(obj) {
|
||||||
|
for (var key in obj) {
|
||||||
|
if (obj.hasOwnProperty(key)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
var proto$1 = {
|
||||||
|
type: COMPONENT_MAIN_TYPE_BMAP,
|
||||||
|
_oldMoveHandler: undefined,
|
||||||
|
_oldZoomEndHandler: undefined,
|
||||||
|
render: function (bMapModel, ecModel, api) {
|
||||||
|
var rendering = true;
|
||||||
|
var bmap = bMapModel.getBMap();
|
||||||
|
var viewportRoot = api.getZr().painter.getViewportRoot();
|
||||||
|
var coordSys = bMapModel.coordinateSystem;
|
||||||
|
var moveHandler = function () {
|
||||||
|
if (rendering) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
var offsetEl = viewportRoot.parentNode.parentNode.parentNode;
|
||||||
|
var mapOffset = [-parseInt(offsetEl.style.left, 10) || 0, -parseInt(offsetEl.style.top, 10) || 0];
|
||||||
|
// only update style when map offset changed
|
||||||
|
var viewportRootStyle = viewportRoot.style;
|
||||||
|
var offsetLeft = mapOffset[0] + 'px';
|
||||||
|
var offsetTop = mapOffset[1] + 'px';
|
||||||
|
if (viewportRootStyle.left !== offsetLeft) {
|
||||||
|
viewportRootStyle.left = offsetLeft;
|
||||||
|
}
|
||||||
|
if (viewportRootStyle.top !== offsetTop) {
|
||||||
|
viewportRootStyle.top = offsetTop;
|
||||||
|
}
|
||||||
|
coordSys.setMapOffset(mapOffset);
|
||||||
|
bMapModel.__mapOffset = mapOffset;
|
||||||
|
api.dispatchAction({
|
||||||
|
type: 'bmapRoam',
|
||||||
|
animation: {
|
||||||
|
duration: 0
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
function zoomEndHandler() {
|
||||||
|
if (rendering) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
api.dispatchAction({
|
||||||
|
type: 'bmapRoam',
|
||||||
|
animation: {
|
||||||
|
duration: 0
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
bmap.removeEventListener('moving', this._oldMoveHandler);
|
||||||
|
bmap.removeEventListener('moveend', this._oldMoveHandler);
|
||||||
|
bmap.removeEventListener('zoomend', this._oldZoomEndHandler);
|
||||||
|
bmap.addEventListener('moving', moveHandler);
|
||||||
|
bmap.addEventListener('moveend', moveHandler);
|
||||||
|
bmap.addEventListener('zoomend', zoomEndHandler);
|
||||||
|
this._oldMoveHandler = moveHandler;
|
||||||
|
this._oldZoomEndHandler = zoomEndHandler;
|
||||||
|
var roam = bMapModel.get('roam');
|
||||||
|
if (roam && roam !== 'scale') {
|
||||||
|
bmap.enableDragging();
|
||||||
|
} else {
|
||||||
|
bmap.disableDragging();
|
||||||
|
}
|
||||||
|
if (roam && roam !== 'move') {
|
||||||
|
bmap.enableScrollWheelZoom();
|
||||||
|
bmap.enableDoubleClickZoom();
|
||||||
|
bmap.enablePinchToZoom();
|
||||||
|
} else {
|
||||||
|
bmap.disableScrollWheelZoom();
|
||||||
|
bmap.disableDoubleClickZoom();
|
||||||
|
bmap.disablePinchToZoom();
|
||||||
|
}
|
||||||
|
/* map 2.0 */
|
||||||
|
var originalStyle = bMapModel.__mapStyle;
|
||||||
|
var newMapStyle = bMapModel.get('mapStyle') || {};
|
||||||
|
// FIXME, Not use JSON methods
|
||||||
|
var mapStyleStr = JSON.stringify(newMapStyle);
|
||||||
|
if (JSON.stringify(originalStyle) !== mapStyleStr) {
|
||||||
|
// FIXME May have blank tile when dragging if setMapStyle
|
||||||
|
if (!isEmptyObject(newMapStyle)) {
|
||||||
|
bmap.setMapStyle(echarts.util.clone(newMapStyle));
|
||||||
|
}
|
||||||
|
bMapModel.__mapStyle = JSON.parse(mapStyleStr);
|
||||||
|
}
|
||||||
|
/* map 3.0 */
|
||||||
|
var originalStyle2 = bMapModel.__mapStyle2;
|
||||||
|
var newMapStyle2 = bMapModel.get('mapStyleV2') || {};
|
||||||
|
// FIXME, Not use JSON methods
|
||||||
|
var mapStyleStr2 = JSON.stringify(newMapStyle2);
|
||||||
|
if (JSON.stringify(originalStyle2) !== mapStyleStr2) {
|
||||||
|
// FIXME May have blank tile when dragging if setMapStyle
|
||||||
|
if (!isEmptyObject(newMapStyle2)) {
|
||||||
|
bmap.setMapStyleV2(echarts.util.clone(newMapStyle2));
|
||||||
|
}
|
||||||
|
bMapModel.__mapStyle2 = JSON.parse(mapStyleStr2);
|
||||||
|
}
|
||||||
|
rendering = false;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
echarts.extendComponentView(proto$1);
|
||||||
|
|
||||||
|
// Action
|
||||||
|
echarts.registerAction({
|
||||||
|
type: 'bmapRoam',
|
||||||
|
event: 'bmapRoam',
|
||||||
|
update: 'updateLayout'
|
||||||
|
}, function (payload, ecModel) {
|
||||||
|
ecModel.eachComponent(COMPONENT_MAIN_TYPE_BMAP, function (bMapModel) {
|
||||||
|
var bmap = bMapModel.getBMap();
|
||||||
|
var center = bmap.getCenter();
|
||||||
|
bMapModel.setCenterAndZoom([center.lng, center.lat], bmap.getZoom());
|
||||||
|
});
|
||||||
|
});
|
||||||
|
var version = '1.0.0';
|
||||||
|
|
||||||
|
exports.version = version;
|
||||||
|
|
||||||
|
Object.defineProperty(exports, '__esModule', { value: true });
|
||||||
|
|
||||||
|
})));
|
||||||
|
//# sourceMappingURL=bmap.js.map
|
||||||
+1
File diff suppressed because one or more lines are too long
+21
File diff suppressed because one or more lines are too long
+402
@@ -0,0 +1,402 @@
|
|||||||
|
|
||||||
|
/*
|
||||||
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
* distributed with this work for additional information
|
||||||
|
* regarding copyright ownership. The ASF licenses this file
|
||||||
|
* to you under the Apache License, Version 2.0 (the
|
||||||
|
* "License"); you may not use this file except in compliance
|
||||||
|
* with the License. You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing,
|
||||||
|
* software distributed under the License is distributed on an
|
||||||
|
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||||
|
* KIND, either express or implied. See the License for the
|
||||||
|
* specific language governing permissions and limitations
|
||||||
|
* under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
(function (global, factory) {
|
||||||
|
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('echarts')) :
|
||||||
|
typeof define === 'function' && define.amd ? define(['exports', 'echarts'], factory) :
|
||||||
|
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.dataTool = {}, global.echarts));
|
||||||
|
}(this, (function (exports, echarts) { 'use strict';
|
||||||
|
|
||||||
|
var BUILTIN_OBJECT = reduce([
|
||||||
|
'Function',
|
||||||
|
'RegExp',
|
||||||
|
'Date',
|
||||||
|
'Error',
|
||||||
|
'CanvasGradient',
|
||||||
|
'CanvasPattern',
|
||||||
|
'Image',
|
||||||
|
'Canvas'
|
||||||
|
], function (obj, val) {
|
||||||
|
obj['[object ' + val + ']'] = true;
|
||||||
|
return obj;
|
||||||
|
}, {});
|
||||||
|
var TYPED_ARRAY = reduce([
|
||||||
|
'Int8',
|
||||||
|
'Uint8',
|
||||||
|
'Uint8Clamped',
|
||||||
|
'Int16',
|
||||||
|
'Uint16',
|
||||||
|
'Int32',
|
||||||
|
'Uint32',
|
||||||
|
'Float32',
|
||||||
|
'Float64'
|
||||||
|
], function (obj, val) {
|
||||||
|
obj['[object ' + val + 'Array]'] = true;
|
||||||
|
return obj;
|
||||||
|
}, {});
|
||||||
|
var arrayProto = Array.prototype;
|
||||||
|
var nativeSlice = arrayProto.slice;
|
||||||
|
var nativeMap = arrayProto.map;
|
||||||
|
var ctorFunction = function () { }.constructor;
|
||||||
|
var protoFunction = ctorFunction ? ctorFunction.prototype : null;
|
||||||
|
function map(arr, cb, context) {
|
||||||
|
if (!arr) {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
if (!cb) {
|
||||||
|
return slice(arr);
|
||||||
|
}
|
||||||
|
if (arr.map && arr.map === nativeMap) {
|
||||||
|
return arr.map(cb, context);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
var result = [];
|
||||||
|
for (var i = 0, len = arr.length; i < len; i++) {
|
||||||
|
result.push(cb.call(context, arr[i], i, arr));
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function reduce(arr, cb, memo, context) {
|
||||||
|
if (!(arr && cb)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
for (var i = 0, len = arr.length; i < len; i++) {
|
||||||
|
memo = cb.call(context, memo, arr[i], i, arr);
|
||||||
|
}
|
||||||
|
return memo;
|
||||||
|
}
|
||||||
|
function bindPolyfill(func, context) {
|
||||||
|
var args = [];
|
||||||
|
for (var _i = 2; _i < arguments.length; _i++) {
|
||||||
|
args[_i - 2] = arguments[_i];
|
||||||
|
}
|
||||||
|
return function () {
|
||||||
|
return func.apply(context, args.concat(nativeSlice.call(arguments)));
|
||||||
|
};
|
||||||
|
}
|
||||||
|
var bind = (protoFunction && isFunction(protoFunction.bind))
|
||||||
|
? protoFunction.call.bind(protoFunction.bind)
|
||||||
|
: bindPolyfill;
|
||||||
|
function isFunction(value) {
|
||||||
|
return typeof value === 'function';
|
||||||
|
}
|
||||||
|
function slice(arr) {
|
||||||
|
var args = [];
|
||||||
|
for (var _i = 1; _i < arguments.length; _i++) {
|
||||||
|
args[_i - 1] = arguments[_i];
|
||||||
|
}
|
||||||
|
return nativeSlice.apply(arr, args);
|
||||||
|
}
|
||||||
|
|
||||||
|
function parse(xml) {
|
||||||
|
var doc;
|
||||||
|
if (typeof xml === 'string') {
|
||||||
|
var parser = new DOMParser();
|
||||||
|
doc = parser.parseFromString(xml, 'text/xml');
|
||||||
|
} else {
|
||||||
|
doc = xml;
|
||||||
|
}
|
||||||
|
if (!doc || doc.getElementsByTagName('parsererror').length) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
var gexfRoot = getChildByTagName(doc, 'gexf');
|
||||||
|
if (!gexfRoot) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
var graphRoot = getChildByTagName(gexfRoot, 'graph');
|
||||||
|
var attributes = parseAttributes(getChildByTagName(graphRoot, 'attributes'));
|
||||||
|
var attributesMap = {};
|
||||||
|
for (var i = 0; i < attributes.length; i++) {
|
||||||
|
attributesMap[attributes[i].id] = attributes[i];
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
nodes: parseNodes(getChildByTagName(graphRoot, 'nodes'), attributesMap),
|
||||||
|
links: parseEdges(getChildByTagName(graphRoot, 'edges'))
|
||||||
|
};
|
||||||
|
}
|
||||||
|
function parseAttributes(parent) {
|
||||||
|
return parent ? map(getChildrenByTagName(parent, 'attribute'), function (attribDom) {
|
||||||
|
return {
|
||||||
|
id: getAttr(attribDom, 'id'),
|
||||||
|
title: getAttr(attribDom, 'title'),
|
||||||
|
type: getAttr(attribDom, 'type')
|
||||||
|
};
|
||||||
|
}) : [];
|
||||||
|
}
|
||||||
|
function parseNodes(parent, attributesMap) {
|
||||||
|
return parent ? map(getChildrenByTagName(parent, 'node'), function (nodeDom) {
|
||||||
|
var id = getAttr(nodeDom, 'id');
|
||||||
|
var label = getAttr(nodeDom, 'label');
|
||||||
|
var node = {
|
||||||
|
id: id,
|
||||||
|
name: label,
|
||||||
|
itemStyle: {
|
||||||
|
normal: {}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
var vizSizeDom = getChildByTagName(nodeDom, 'viz:size');
|
||||||
|
var vizPosDom = getChildByTagName(nodeDom, 'viz:position');
|
||||||
|
var vizColorDom = getChildByTagName(nodeDom, 'viz:color');
|
||||||
|
// let vizShapeDom = getChildByTagName(nodeDom, 'viz:shape');
|
||||||
|
var attvaluesDom = getChildByTagName(nodeDom, 'attvalues');
|
||||||
|
if (vizSizeDom) {
|
||||||
|
node.symbolSize = parseFloat(getAttr(vizSizeDom, 'value'));
|
||||||
|
}
|
||||||
|
if (vizPosDom) {
|
||||||
|
node.x = parseFloat(getAttr(vizPosDom, 'x'));
|
||||||
|
node.y = parseFloat(getAttr(vizPosDom, 'y'));
|
||||||
|
// z
|
||||||
|
}
|
||||||
|
if (vizColorDom) {
|
||||||
|
node.itemStyle.normal.color = 'rgb(' + [getAttr(vizColorDom, 'r') | 0, getAttr(vizColorDom, 'g') | 0, getAttr(vizColorDom, 'b') | 0].join(',') + ')';
|
||||||
|
}
|
||||||
|
// if (vizShapeDom) {
|
||||||
|
// node.shape = getAttr(vizShapeDom, 'shape');
|
||||||
|
// }
|
||||||
|
if (attvaluesDom) {
|
||||||
|
var attvalueDomList = getChildrenByTagName(attvaluesDom, 'attvalue');
|
||||||
|
node.attributes = {};
|
||||||
|
for (var j = 0; j < attvalueDomList.length; j++) {
|
||||||
|
var attvalueDom = attvalueDomList[j];
|
||||||
|
var attId = getAttr(attvalueDom, 'for');
|
||||||
|
var attValue = getAttr(attvalueDom, 'value');
|
||||||
|
var attribute = attributesMap[attId];
|
||||||
|
if (attribute) {
|
||||||
|
switch (attribute.type) {
|
||||||
|
case 'integer':
|
||||||
|
case 'long':
|
||||||
|
attValue = parseInt(attValue, 10);
|
||||||
|
break;
|
||||||
|
case 'float':
|
||||||
|
case 'double':
|
||||||
|
attValue = parseFloat(attValue);
|
||||||
|
break;
|
||||||
|
case 'boolean':
|
||||||
|
attValue = attValue.toLowerCase() === 'true';
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
node.attributes[attId] = attValue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return node;
|
||||||
|
}) : [];
|
||||||
|
}
|
||||||
|
function parseEdges(parent) {
|
||||||
|
return parent ? map(getChildrenByTagName(parent, 'edge'), function (edgeDom) {
|
||||||
|
var id = getAttr(edgeDom, 'id');
|
||||||
|
var label = getAttr(edgeDom, 'label');
|
||||||
|
var sourceId = getAttr(edgeDom, 'source');
|
||||||
|
var targetId = getAttr(edgeDom, 'target');
|
||||||
|
var edge = {
|
||||||
|
id: id,
|
||||||
|
name: label,
|
||||||
|
source: sourceId,
|
||||||
|
target: targetId,
|
||||||
|
lineStyle: {
|
||||||
|
normal: {}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
var lineStyle = edge.lineStyle.normal;
|
||||||
|
var vizThicknessDom = getChildByTagName(edgeDom, 'viz:thickness');
|
||||||
|
var vizColorDom = getChildByTagName(edgeDom, 'viz:color');
|
||||||
|
// let vizShapeDom = getChildByTagName(edgeDom, 'viz:shape');
|
||||||
|
if (vizThicknessDom) {
|
||||||
|
lineStyle.width = parseFloat(vizThicknessDom.getAttribute('value'));
|
||||||
|
}
|
||||||
|
if (vizColorDom) {
|
||||||
|
lineStyle.color = 'rgb(' + [getAttr(vizColorDom, 'r') | 0, getAttr(vizColorDom, 'g') | 0, getAttr(vizColorDom, 'b') | 0].join(',') + ')';
|
||||||
|
}
|
||||||
|
// if (vizShapeDom) {
|
||||||
|
// edge.shape = vizShapeDom.getAttribute('shape');
|
||||||
|
// }
|
||||||
|
return edge;
|
||||||
|
}) : [];
|
||||||
|
}
|
||||||
|
function getAttr(el, attrName) {
|
||||||
|
return el.getAttribute(attrName);
|
||||||
|
}
|
||||||
|
function getChildByTagName(parent, tagName) {
|
||||||
|
var node = parent.firstChild;
|
||||||
|
while (node) {
|
||||||
|
if (node.nodeType !== 1 || node.nodeName.toLowerCase() !== tagName.toLowerCase()) {
|
||||||
|
node = node.nextSibling;
|
||||||
|
} else {
|
||||||
|
return node;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
function getChildrenByTagName(parent, tagName) {
|
||||||
|
var node = parent.firstChild;
|
||||||
|
var children = [];
|
||||||
|
while (node) {
|
||||||
|
if (node.nodeName.toLowerCase() === tagName.toLowerCase()) {
|
||||||
|
children.push(node);
|
||||||
|
}
|
||||||
|
node = node.nextSibling;
|
||||||
|
}
|
||||||
|
return children;
|
||||||
|
}
|
||||||
|
|
||||||
|
var gexf = /*#__PURE__*/Object.freeze({
|
||||||
|
__proto__: null,
|
||||||
|
parse: parse
|
||||||
|
});
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
* distributed with this work for additional information
|
||||||
|
* regarding copyright ownership. The ASF licenses this file
|
||||||
|
* to you under the Apache License, Version 2.0 (the
|
||||||
|
* "License"); you may not use this file except in compliance
|
||||||
|
* with the License. You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing,
|
||||||
|
* software distributed under the License is distributed on an
|
||||||
|
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||||
|
* KIND, either express or implied. See the License for the
|
||||||
|
* specific language governing permissions and limitations
|
||||||
|
* under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* AUTO-GENERATED FILE. DO NOT MODIFY.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
* distributed with this work for additional information
|
||||||
|
* regarding copyright ownership. The ASF licenses this file
|
||||||
|
* to you under the Apache License, Version 2.0 (the
|
||||||
|
* "License"); you may not use this file except in compliance
|
||||||
|
* with the License. You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing,
|
||||||
|
* software distributed under the License is distributed on an
|
||||||
|
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||||
|
* KIND, either express or implied. See the License for the
|
||||||
|
* specific language governing permissions and limitations
|
||||||
|
* under the License.
|
||||||
|
*/
|
||||||
|
function asc(arr) {
|
||||||
|
arr.sort(function (a, b) {
|
||||||
|
return a - b;
|
||||||
|
});
|
||||||
|
return arr;
|
||||||
|
}
|
||||||
|
function quantile(ascArr, p) {
|
||||||
|
var H = (ascArr.length - 1) * p + 1;
|
||||||
|
var h = Math.floor(H);
|
||||||
|
var v = +ascArr[h - 1];
|
||||||
|
var e = H - h;
|
||||||
|
return e ? v + e * (ascArr[h] - v) : v;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* See:
|
||||||
|
* <https://en.wikipedia.org/wiki/Box_plot#cite_note-frigge_hoaglin_iglewicz-2>
|
||||||
|
* <http://stat.ethz.ch/R-manual/R-devel/library/grDevices/html/boxplot.stats.html>
|
||||||
|
*
|
||||||
|
* Helper method for preparing data.
|
||||||
|
*
|
||||||
|
* @param {Array.<number>} rawData like
|
||||||
|
* [
|
||||||
|
* [12,232,443], (raw data set for the first box)
|
||||||
|
* [3843,5545,1232], (raw data set for the second box)
|
||||||
|
* ...
|
||||||
|
* ]
|
||||||
|
* @param {Object} [opt]
|
||||||
|
*
|
||||||
|
* @param {(number|string)} [opt.boundIQR=1.5] Data less than min bound is outlier.
|
||||||
|
* default 1.5, means Q1 - 1.5 * (Q3 - Q1).
|
||||||
|
* If 'none'/0 passed, min bound will not be used.
|
||||||
|
* @param {(number|string)} [opt.layout='horizontal']
|
||||||
|
* Box plot layout, can be 'horizontal' or 'vertical'
|
||||||
|
* @return {Object} {
|
||||||
|
* boxData: Array.<Array.<number>>
|
||||||
|
* outliers: Array.<Array.<number>>
|
||||||
|
* axisData: Array.<string>
|
||||||
|
* }
|
||||||
|
*/
|
||||||
|
function prepareBoxplotData (rawData, opt) {
|
||||||
|
opt = opt || {};
|
||||||
|
var boxData = [];
|
||||||
|
var outliers = [];
|
||||||
|
var axisData = [];
|
||||||
|
var boundIQR = opt.boundIQR;
|
||||||
|
var useExtreme = boundIQR === 'none' || boundIQR === 0;
|
||||||
|
for (var i = 0; i < rawData.length; i++) {
|
||||||
|
axisData.push(i + '');
|
||||||
|
var ascList = asc(rawData[i].slice());
|
||||||
|
var Q1 = quantile(ascList, 0.25);
|
||||||
|
var Q2 = quantile(ascList, 0.5);
|
||||||
|
var Q3 = quantile(ascList, 0.75);
|
||||||
|
var min = ascList[0];
|
||||||
|
var max = ascList[ascList.length - 1];
|
||||||
|
var bound = (boundIQR == null ? 1.5 : boundIQR) * (Q3 - Q1);
|
||||||
|
var low = useExtreme ? min : Math.max(min, Q1 - bound);
|
||||||
|
var high = useExtreme ? max : Math.min(max, Q3 + bound);
|
||||||
|
boxData.push([low, Q1, Q2, Q3, high]);
|
||||||
|
for (var j = 0; j < ascList.length; j++) {
|
||||||
|
var dataItem = ascList[j];
|
||||||
|
if (dataItem < low || dataItem > high) {
|
||||||
|
var outlier = [i, dataItem];
|
||||||
|
opt.layout === 'vertical' && outlier.reverse();
|
||||||
|
outliers.push(outlier);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
boxData: boxData,
|
||||||
|
outliers: outliers,
|
||||||
|
axisData: axisData
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
// import { boxplotTransform } from './boxplotTransform.js';
|
||||||
|
var version = '1.0.0';
|
||||||
|
// export {boxplotTransform};
|
||||||
|
// For backward compatibility, where the namespace `dataTool` will
|
||||||
|
// be mounted on `echarts` is the extension `dataTool` is imported.
|
||||||
|
// But the old version of echarts do not have `dataTool` namespace,
|
||||||
|
// so check it before mounting.
|
||||||
|
if (echarts.dataTool) {
|
||||||
|
echarts.dataTool.version = version;
|
||||||
|
echarts.dataTool.gexf = gexf;
|
||||||
|
echarts.dataTool.prepareBoxplotData = prepareBoxplotData;
|
||||||
|
// echarts.dataTool.boxplotTransform = boxplotTransform;
|
||||||
|
}
|
||||||
|
|
||||||
|
exports.gexf = gexf;
|
||||||
|
exports.prepareBoxplotData = prepareBoxplotData;
|
||||||
|
exports.version = version;
|
||||||
|
|
||||||
|
Object.defineProperty(exports, '__esModule', { value: true });
|
||||||
|
|
||||||
|
})));
|
||||||
|
//# sourceMappingURL=dataTool.js.map
|
||||||
+1
File diff suppressed because one or more lines are too long
+21
@@ -0,0 +1,21 @@
|
|||||||
|
|
||||||
|
/*
|
||||||
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
* distributed with this work for additional information
|
||||||
|
* regarding copyright ownership. The ASF licenses this file
|
||||||
|
* to you under the Apache License, Version 2.0 (the
|
||||||
|
* "License"); you may not use this file except in compliance
|
||||||
|
* with the License. You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing,
|
||||||
|
* software distributed under the License is distributed on an
|
||||||
|
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||||
|
* KIND, either express or implied. See the License for the
|
||||||
|
* specific language governing permissions and limitations
|
||||||
|
* under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("echarts")):"function"==typeof define&&define.amd?define(["exports","echarts"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).dataTool={},e.echarts)}(this,function(e,t){"use strict";u(["Function","RegExp","Date","Error","CanvasGradient","CanvasPattern","Image","Canvas"],function(e,t){return e["[object "+t+"]"]=!0,e},{}),u(["Int8","Uint8","Uint8Clamped","Int16","Uint16","Int32","Uint32","Float32","Float64"],function(e,t){return e["[object "+t+"Array]"]=!0,e},{});var r=Array.prototype,n=r.slice,a=r.map,o=function(){}.constructor,i=o?o.prototype:null;function l(e,t,r){if(!e)return[];if(!t)return function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];return n.apply(e,t)}(e);if(e.map&&e.map===a)return e.map(t,r);for(var o=[],i=0,l=e.length;i<l;i++)o.push(t.call(r,e[i],i,e));return o}function u(e,t,r,n){if(e&&t){for(var a=0,o=e.length;a<o;a++)r=t.call(n,r,e[a],a,e);return r}}i&&"function"==typeof i.bind&&i.call.bind(i.bind);function s(e,t){return e?l(d(e,"node"),function(e){var r={id:c(e,"id"),name:c(e,"label"),itemStyle:{normal:{}}},n=p(e,"viz:size"),a=p(e,"viz:position"),o=p(e,"viz:color"),i=p(e,"attvalues");if(n&&(r.symbolSize=parseFloat(c(n,"value"))),a&&(r.x=parseFloat(c(a,"x")),r.y=parseFloat(c(a,"y"))),o&&(r.itemStyle.normal.color="rgb("+[0|c(o,"r"),0|c(o,"g"),0|c(o,"b")].join(",")+")"),i){var l=d(i,"attvalue");r.attributes={};for(var u=0;u<l.length;u++){var s=l[u],f=c(s,"for"),v=c(s,"value"),g=t[f];if(g){switch(g.type){case"integer":case"long":v=parseInt(v,10);break;case"float":case"double":v=parseFloat(v);break;case"boolean":v="true"===v.toLowerCase()}r.attributes[f]=v}}}return r}):[]}function f(e){return e?l(d(e,"edge"),function(e){var t={id:c(e,"id"),name:c(e,"label"),source:c(e,"source"),target:c(e,"target"),lineStyle:{normal:{}}},r=t.lineStyle.normal,n=p(e,"viz:thickness"),a=p(e,"viz:color");return n&&(r.width=parseFloat(n.getAttribute("value"))),a&&(r.color="rgb("+[0|c(a,"r"),0|c(a,"g"),0|c(a,"b")].join(",")+")"),t}):[]}function c(e,t){return e.getAttribute(t)}function p(e,t){for(var r=e.firstChild;r;){if(1===r.nodeType&&r.nodeName.toLowerCase()===t.toLowerCase())return r;r=r.nextSibling}return null}function d(e,t){for(var r=e.firstChild,n=[];r;)r.nodeName.toLowerCase()===t.toLowerCase()&&n.push(r),r=r.nextSibling;return n}var v=Object.freeze({__proto__:null,parse:function(e){var t;if(!(t="string"==typeof e?(new DOMParser).parseFromString(e,"text/xml"):e)||t.getElementsByTagName("parsererror").length)return null;var r=p(t,"gexf");if(!r)return null;for(var n,a=p(r,"graph"),o=(n=p(a,"attributes"))?l(d(n,"attribute"),function(e){return{id:c(e,"id"),title:c(e,"title"),type:c(e,"type")}}):[],i={},u=0;u<o.length;u++)i[o[u].id]=o[u];return{nodes:s(p(a,"nodes"),i),links:f(p(a,"edges"))}}});function g(e){return e.sort(function(e,t){return e-t}),e}function b(e,t){var r=(e.length-1)*t+1,n=Math.floor(r),a=+e[n-1],o=r-n;return o?a+o*(e[n]-a):a}function h(e,t){for(var r=[],n=[],a=[],o=(t=t||{}).boundIQR,i="none"===o||0===o,l=0;l<e.length;l++){a.push(l+"");var u=g(e[l].slice()),s=b(u,.25),f=b(u,.5),c=b(u,.75),p=u[0],d=u[u.length-1],v=(null==o?1.5:o)*(c-s),h=i?p:Math.max(p,s-v),m=i?d:Math.min(d,c+v);r.push([h,s,f,c,m]);for(var y=0;y<u.length;y++){var x=u[y];if(x<h||x>m){var C=[l,x];"vertical"===t.layout&&C.reverse(),n.push(C)}}}return{boxData:r,outliers:n,axisData:a}}var m="1.0.0";t.dataTool&&(t.dataTool.version=m,t.dataTool.gexf=v,t.dataTool.prepareBoxplotData=h),e.gexf=v,e.prepareBoxplotData=h,e.version=m,Object.defineProperty(e,"__esModule",{value:!0})});
|
||||||
+3
@@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"type": "commonjs"
|
||||||
|
}
|
||||||
+244
@@ -0,0 +1,244 @@
|
|||||||
|
|
||||||
|
/*
|
||||||
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
* distributed with this work for additional information
|
||||||
|
* regarding copyright ownership. The ASF licenses this file
|
||||||
|
* to you under the Apache License, Version 2.0 (the
|
||||||
|
* "License"); you may not use this file except in compliance
|
||||||
|
* with the License. You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing,
|
||||||
|
* software distributed under the License is distributed on an
|
||||||
|
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||||
|
* KIND, either express or implied. See the License for the
|
||||||
|
* specific language governing permissions and limitations
|
||||||
|
* under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* AUTO-GENERATED FILE. DO NOT MODIFY.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
* distributed with this work for additional information
|
||||||
|
* regarding copyright ownership. The ASF licenses this file
|
||||||
|
* to you under the Apache License, Version 2.0 (the
|
||||||
|
* "License"); you may not use this file except in compliance
|
||||||
|
* with the License. You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing,
|
||||||
|
* software distributed under the License is distributed on an
|
||||||
|
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||||
|
* KIND, either express or implied. See the License for the
|
||||||
|
* specific language governing permissions and limitations
|
||||||
|
* under the License.
|
||||||
|
*/
|
||||||
|
/* global document */
|
||||||
|
import { util as zrUtil, graphic, matrix, registerCoordinateSystem } from 'echarts';
|
||||||
|
import { COMPONENT_MAIN_TYPE_BMAP } from './BMapModel.js';
|
||||||
|
var COORD_SYS_BMAP = COMPONENT_MAIN_TYPE_BMAP;
|
||||||
|
function makeDimensions() {
|
||||||
|
return ['lng', 'lat'];
|
||||||
|
}
|
||||||
|
var BMapCoordSys = /** @class */function () {
|
||||||
|
function BMapCoordSys(bmap, api) {
|
||||||
|
this.dimensions = makeDimensions();
|
||||||
|
this.type = COORD_SYS_BMAP;
|
||||||
|
this._mapOffset = [0, 0];
|
||||||
|
this._projection = new BMap.MercatorProjection();
|
||||||
|
this._bmap = bmap;
|
||||||
|
this._api = api;
|
||||||
|
}
|
||||||
|
BMapCoordSys.prototype.setZoom = function (zoom) {
|
||||||
|
this._zoom = zoom;
|
||||||
|
};
|
||||||
|
BMapCoordSys.prototype.setCenter = function (center) {
|
||||||
|
this._center = this._projection.lngLatToPoint(new BMap.Point(center[0], center[1]));
|
||||||
|
};
|
||||||
|
BMapCoordSys.prototype.setMapOffset = function (mapOffset) {
|
||||||
|
this._mapOffset = mapOffset;
|
||||||
|
};
|
||||||
|
BMapCoordSys.prototype.getBMap = function () {
|
||||||
|
return this._bmap;
|
||||||
|
};
|
||||||
|
BMapCoordSys.prototype.dataToPoint = function (data) {
|
||||||
|
var point = new BMap.Point(data[0], data[1]);
|
||||||
|
// TODO mercator projection is toooooooo slow
|
||||||
|
// let mercatorPoint = this._projection.lngLatToPoint(point);
|
||||||
|
// let width = this._api.getZr().getWidth();
|
||||||
|
// let height = this._api.getZr().getHeight();
|
||||||
|
// let divider = Math.pow(2, 18 - 10);
|
||||||
|
// return [
|
||||||
|
// Math.round((mercatorPoint.x - this._center.x) / divider + width / 2),
|
||||||
|
// Math.round((this._center.y - mercatorPoint.y) / divider + height / 2)
|
||||||
|
// ];
|
||||||
|
var px = this._bmap.pointToOverlayPixel(point);
|
||||||
|
var mapOffset = this._mapOffset;
|
||||||
|
return [px.x - mapOffset[0], px.y - mapOffset[1]];
|
||||||
|
};
|
||||||
|
BMapCoordSys.prototype.pointToData = function (point) {
|
||||||
|
var mapOffset = this._mapOffset;
|
||||||
|
var pt = this._bmap.overlayPixelToPoint({
|
||||||
|
x: point[0] + mapOffset[0],
|
||||||
|
y: point[1] + mapOffset[1]
|
||||||
|
});
|
||||||
|
return [pt.lng, pt.lat];
|
||||||
|
};
|
||||||
|
BMapCoordSys.prototype.containPoint = function (point) {
|
||||||
|
// Currently, bmap takes the entire canvas.
|
||||||
|
return true;
|
||||||
|
};
|
||||||
|
BMapCoordSys.prototype.getViewRect = function () {
|
||||||
|
var api = this._api;
|
||||||
|
return new graphic.BoundingRect(0, 0, api.getWidth(), api.getHeight());
|
||||||
|
};
|
||||||
|
BMapCoordSys.prototype.getRoamTransform = function () {
|
||||||
|
return matrix.create();
|
||||||
|
};
|
||||||
|
BMapCoordSys.prototype.prepareCustoms = function () {
|
||||||
|
var rect = this.getViewRect();
|
||||||
|
return {
|
||||||
|
coordSys: {
|
||||||
|
// The name exposed to user is always 'cartesian2d' but not 'grid'.
|
||||||
|
type: COORD_SYS_BMAP,
|
||||||
|
x: rect.x,
|
||||||
|
y: rect.y,
|
||||||
|
width: rect.width,
|
||||||
|
height: rect.height
|
||||||
|
},
|
||||||
|
api: {
|
||||||
|
coord: zrUtil.bind(this.dataToPoint, this),
|
||||||
|
size: zrUtil.bind(dataToCoordSize, this)
|
||||||
|
}
|
||||||
|
};
|
||||||
|
};
|
||||||
|
BMapCoordSys.prototype.convertToPixel = function (ecModel, finder, value) {
|
||||||
|
// here we ignore finder as only one bmap component is allowed
|
||||||
|
return this.dataToPoint(value);
|
||||||
|
};
|
||||||
|
BMapCoordSys.prototype.convertFromPixel = function (ecModel, finder, value) {
|
||||||
|
return this.pointToData(value);
|
||||||
|
};
|
||||||
|
// For deciding which dimensions to use when creating list data
|
||||||
|
BMapCoordSys.dimensions = makeDimensions();
|
||||||
|
return BMapCoordSys;
|
||||||
|
}();
|
||||||
|
export { BMapCoordSys };
|
||||||
|
BMapCoordSys.prototype.dimensions = makeDimensions(); // For backward compatibility.
|
||||||
|
function dataToCoordSize(dataSize, dataItem) {
|
||||||
|
dataItem = dataItem || [0, 0];
|
||||||
|
return zrUtil.map([0, 1], function (dimIdx) {
|
||||||
|
var val = dataItem[dimIdx];
|
||||||
|
var halfSize = dataSize[dimIdx] / 2;
|
||||||
|
var p1 = [];
|
||||||
|
var p2 = [];
|
||||||
|
p1[dimIdx] = val - halfSize;
|
||||||
|
p2[dimIdx] = val + halfSize;
|
||||||
|
p1[1 - dimIdx] = p2[1 - dimIdx] = dataItem[1 - dimIdx];
|
||||||
|
return Math.abs(this.dataToPoint(p1)[dimIdx] - this.dataToPoint(p2)[dimIdx]);
|
||||||
|
}, this);
|
||||||
|
}
|
||||||
|
var Overlay;
|
||||||
|
function createOverlayCtor() {
|
||||||
|
function Overlay(root) {
|
||||||
|
this._root = root;
|
||||||
|
}
|
||||||
|
Overlay.prototype = new BMap.Overlay();
|
||||||
|
/**
|
||||||
|
* @override
|
||||||
|
*/
|
||||||
|
Overlay.prototype.initialize = function (map) {
|
||||||
|
map.getPanes().labelPane.appendChild(this._root);
|
||||||
|
return this._root;
|
||||||
|
};
|
||||||
|
/**
|
||||||
|
* @override
|
||||||
|
*/
|
||||||
|
Overlay.prototype.draw = function () {};
|
||||||
|
return Overlay;
|
||||||
|
}
|
||||||
|
BMapCoordSys.create = function (ecModel, api) {
|
||||||
|
var bmapCoordSys;
|
||||||
|
var root = api.getDom();
|
||||||
|
// TODO Dispose
|
||||||
|
ecModel.eachComponent(COMPONENT_MAIN_TYPE_BMAP, function (bmapModel) {
|
||||||
|
var painter = api.getZr().painter;
|
||||||
|
var viewportRoot = painter.getViewportRoot();
|
||||||
|
if (typeof BMap === 'undefined') {
|
||||||
|
throw new Error('BMap api is not loaded');
|
||||||
|
}
|
||||||
|
Overlay = Overlay || createOverlayCtor();
|
||||||
|
if (bmapCoordSys) {
|
||||||
|
throw new Error('Only one bmap component can exist');
|
||||||
|
}
|
||||||
|
var bmap;
|
||||||
|
if (!bmapModel.__bmap) {
|
||||||
|
// Not support IE8
|
||||||
|
var bmapRoot = root.querySelector('.ec-extension-bmap');
|
||||||
|
if (bmapRoot) {
|
||||||
|
// Reset viewport left and top, which will be changed
|
||||||
|
// in moving handler in BMapView
|
||||||
|
viewportRoot.style.left = '0px';
|
||||||
|
viewportRoot.style.top = '0px';
|
||||||
|
root.removeChild(bmapRoot);
|
||||||
|
}
|
||||||
|
bmapRoot = document.createElement('div');
|
||||||
|
bmapRoot.className = 'ec-extension-bmap';
|
||||||
|
// fix #13424
|
||||||
|
bmapRoot.style.cssText = 'position:absolute;width:100%;height:100%';
|
||||||
|
root.appendChild(bmapRoot);
|
||||||
|
// initializes bmap
|
||||||
|
var mapOptions = bmapModel.get('mapOptions');
|
||||||
|
if (mapOptions) {
|
||||||
|
mapOptions = zrUtil.clone(mapOptions);
|
||||||
|
// Not support `mapType`, use `bmap.setMapType(MapType)` instead.
|
||||||
|
delete mapOptions.mapType;
|
||||||
|
}
|
||||||
|
bmap = bmapModel.__bmap = new BMap.Map(bmapRoot, mapOptions);
|
||||||
|
var overlay = new Overlay(viewportRoot);
|
||||||
|
bmap.addOverlay(overlay);
|
||||||
|
// Override
|
||||||
|
painter.getViewportRootOffset = function () {
|
||||||
|
return {
|
||||||
|
offsetLeft: 0,
|
||||||
|
offsetTop: 0
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
bmap = bmapModel.__bmap;
|
||||||
|
// Set bmap options
|
||||||
|
// centerAndZoom before layout and render
|
||||||
|
var center = bmapModel.get('center');
|
||||||
|
var zoom = bmapModel.get('zoom');
|
||||||
|
if (center && zoom) {
|
||||||
|
var bmapCenter = bmap.getCenter();
|
||||||
|
var bmapZoom = bmap.getZoom();
|
||||||
|
var centerOrZoomChanged = bmapModel.centerOrZoomChanged([bmapCenter.lng, bmapCenter.lat], bmapZoom);
|
||||||
|
if (centerOrZoomChanged) {
|
||||||
|
var pt = new BMap.Point(center[0], center[1]);
|
||||||
|
bmap.centerAndZoom(pt, zoom);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
bmapCoordSys = new BMapCoordSys(bmap, api);
|
||||||
|
bmapCoordSys.setMapOffset(bmapModel.__mapOffset || [0, 0]);
|
||||||
|
bmapCoordSys.setZoom(zoom);
|
||||||
|
bmapCoordSys.setCenter(center);
|
||||||
|
bmapModel.coordinateSystem = bmapCoordSys;
|
||||||
|
});
|
||||||
|
ecModel.eachSeries(function (seriesModel) {
|
||||||
|
if (seriesModel.get('coordinateSystem') === COORD_SYS_BMAP) {
|
||||||
|
seriesModel.coordinateSystem = bmapCoordSys;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
// return created coordinate systems
|
||||||
|
return bmapCoordSys && [bmapCoordSys];
|
||||||
|
};
|
||||||
|
registerCoordinateSystem('bmap', BMapCoordSys);
|
||||||
+80
@@ -0,0 +1,80 @@
|
|||||||
|
|
||||||
|
/*
|
||||||
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
* distributed with this work for additional information
|
||||||
|
* regarding copyright ownership. The ASF licenses this file
|
||||||
|
* to you under the Apache License, Version 2.0 (the
|
||||||
|
* "License"); you may not use this file except in compliance
|
||||||
|
* with the License. You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing,
|
||||||
|
* software distributed under the License is distributed on an
|
||||||
|
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||||
|
* KIND, either express or implied. See the License for the
|
||||||
|
* specific language governing permissions and limitations
|
||||||
|
* under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* AUTO-GENERATED FILE. DO NOT MODIFY.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
* distributed with this work for additional information
|
||||||
|
* regarding copyright ownership. The ASF licenses this file
|
||||||
|
* to you under the Apache License, Version 2.0 (the
|
||||||
|
* "License"); you may not use this file except in compliance
|
||||||
|
* with the License. You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing,
|
||||||
|
* software distributed under the License is distributed on an
|
||||||
|
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||||
|
* KIND, either express or implied. See the License for the
|
||||||
|
* specific language governing permissions and limitations
|
||||||
|
* under the License.
|
||||||
|
*/
|
||||||
|
import { extendComponentModel } from 'echarts';
|
||||||
|
function v2Equal(a, b) {
|
||||||
|
return a && b && a[0] === b[0] && a[1] === b[1];
|
||||||
|
}
|
||||||
|
export var COMPONENT_MAIN_TYPE_BMAP = 'bmap';
|
||||||
|
var proto = {
|
||||||
|
type: COMPONENT_MAIN_TYPE_BMAP,
|
||||||
|
__bmap: undefined,
|
||||||
|
__mapOffset: undefined,
|
||||||
|
__mapStyle: undefined,
|
||||||
|
__mapStyle2: undefined,
|
||||||
|
coordinateSystem: undefined,
|
||||||
|
getBMap: function () {
|
||||||
|
// __bmap is injected when creating BMapCoordSys
|
||||||
|
return this.__bmap;
|
||||||
|
},
|
||||||
|
setCenterAndZoom: function (center, zoom) {
|
||||||
|
this.option.center = center;
|
||||||
|
this.option.zoom = zoom;
|
||||||
|
},
|
||||||
|
centerOrZoomChanged: function (center, zoom) {
|
||||||
|
var option = this.option;
|
||||||
|
return !(v2Equal(center, option.center) && zoom === option.zoom);
|
||||||
|
},
|
||||||
|
defaultOption: {
|
||||||
|
center: [104.114129, 37.550339],
|
||||||
|
zoom: 5,
|
||||||
|
// 2.0 https://lbsyun.baidu.com/custom/index.htm
|
||||||
|
mapStyle: {},
|
||||||
|
// 3.0 https://lbsyun.baidu.com/index.php?title=open/custom
|
||||||
|
mapStyleV2: {},
|
||||||
|
// See https://lbsyun.baidu.com/cms/jsapi/reference/jsapi_reference.html#a0b1
|
||||||
|
mapOptions: {},
|
||||||
|
roam: false
|
||||||
|
}
|
||||||
|
};
|
||||||
|
extendComponentModel(proto);
|
||||||
+149
@@ -0,0 +1,149 @@
|
|||||||
|
|
||||||
|
/*
|
||||||
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
* distributed with this work for additional information
|
||||||
|
* regarding copyright ownership. The ASF licenses this file
|
||||||
|
* to you under the Apache License, Version 2.0 (the
|
||||||
|
* "License"); you may not use this file except in compliance
|
||||||
|
* with the License. You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing,
|
||||||
|
* software distributed under the License is distributed on an
|
||||||
|
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||||
|
* KIND, either express or implied. See the License for the
|
||||||
|
* specific language governing permissions and limitations
|
||||||
|
* under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* AUTO-GENERATED FILE. DO NOT MODIFY.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
* distributed with this work for additional information
|
||||||
|
* regarding copyright ownership. The ASF licenses this file
|
||||||
|
* to you under the Apache License, Version 2.0 (the
|
||||||
|
* "License"); you may not use this file except in compliance
|
||||||
|
* with the License. You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing,
|
||||||
|
* software distributed under the License is distributed on an
|
||||||
|
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||||
|
* KIND, either express or implied. See the License for the
|
||||||
|
* specific language governing permissions and limitations
|
||||||
|
* under the License.
|
||||||
|
*/
|
||||||
|
import { extendComponentView, util as zrUtil } from 'echarts';
|
||||||
|
import { COMPONENT_MAIN_TYPE_BMAP } from './BMapModel.js';
|
||||||
|
function isEmptyObject(obj) {
|
||||||
|
for (var key in obj) {
|
||||||
|
if (obj.hasOwnProperty(key)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
var proto = {
|
||||||
|
type: COMPONENT_MAIN_TYPE_BMAP,
|
||||||
|
_oldMoveHandler: undefined,
|
||||||
|
_oldZoomEndHandler: undefined,
|
||||||
|
render: function (bMapModel, ecModel, api) {
|
||||||
|
var rendering = true;
|
||||||
|
var bmap = bMapModel.getBMap();
|
||||||
|
var viewportRoot = api.getZr().painter.getViewportRoot();
|
||||||
|
var coordSys = bMapModel.coordinateSystem;
|
||||||
|
var moveHandler = function () {
|
||||||
|
if (rendering) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
var offsetEl = viewportRoot.parentNode.parentNode.parentNode;
|
||||||
|
var mapOffset = [-parseInt(offsetEl.style.left, 10) || 0, -parseInt(offsetEl.style.top, 10) || 0];
|
||||||
|
// only update style when map offset changed
|
||||||
|
var viewportRootStyle = viewportRoot.style;
|
||||||
|
var offsetLeft = mapOffset[0] + 'px';
|
||||||
|
var offsetTop = mapOffset[1] + 'px';
|
||||||
|
if (viewportRootStyle.left !== offsetLeft) {
|
||||||
|
viewportRootStyle.left = offsetLeft;
|
||||||
|
}
|
||||||
|
if (viewportRootStyle.top !== offsetTop) {
|
||||||
|
viewportRootStyle.top = offsetTop;
|
||||||
|
}
|
||||||
|
coordSys.setMapOffset(mapOffset);
|
||||||
|
bMapModel.__mapOffset = mapOffset;
|
||||||
|
api.dispatchAction({
|
||||||
|
type: 'bmapRoam',
|
||||||
|
animation: {
|
||||||
|
duration: 0
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
function zoomEndHandler() {
|
||||||
|
if (rendering) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
api.dispatchAction({
|
||||||
|
type: 'bmapRoam',
|
||||||
|
animation: {
|
||||||
|
duration: 0
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
bmap.removeEventListener('moving', this._oldMoveHandler);
|
||||||
|
bmap.removeEventListener('moveend', this._oldMoveHandler);
|
||||||
|
bmap.removeEventListener('zoomend', this._oldZoomEndHandler);
|
||||||
|
bmap.addEventListener('moving', moveHandler);
|
||||||
|
bmap.addEventListener('moveend', moveHandler);
|
||||||
|
bmap.addEventListener('zoomend', zoomEndHandler);
|
||||||
|
this._oldMoveHandler = moveHandler;
|
||||||
|
this._oldZoomEndHandler = zoomEndHandler;
|
||||||
|
var roam = bMapModel.get('roam');
|
||||||
|
if (roam && roam !== 'scale') {
|
||||||
|
bmap.enableDragging();
|
||||||
|
} else {
|
||||||
|
bmap.disableDragging();
|
||||||
|
}
|
||||||
|
if (roam && roam !== 'move') {
|
||||||
|
bmap.enableScrollWheelZoom();
|
||||||
|
bmap.enableDoubleClickZoom();
|
||||||
|
bmap.enablePinchToZoom();
|
||||||
|
} else {
|
||||||
|
bmap.disableScrollWheelZoom();
|
||||||
|
bmap.disableDoubleClickZoom();
|
||||||
|
bmap.disablePinchToZoom();
|
||||||
|
}
|
||||||
|
/* map 2.0 */
|
||||||
|
var originalStyle = bMapModel.__mapStyle;
|
||||||
|
var newMapStyle = bMapModel.get('mapStyle') || {};
|
||||||
|
// FIXME, Not use JSON methods
|
||||||
|
var mapStyleStr = JSON.stringify(newMapStyle);
|
||||||
|
if (JSON.stringify(originalStyle) !== mapStyleStr) {
|
||||||
|
// FIXME May have blank tile when dragging if setMapStyle
|
||||||
|
if (!isEmptyObject(newMapStyle)) {
|
||||||
|
bmap.setMapStyle(zrUtil.clone(newMapStyle));
|
||||||
|
}
|
||||||
|
bMapModel.__mapStyle = JSON.parse(mapStyleStr);
|
||||||
|
}
|
||||||
|
/* map 3.0 */
|
||||||
|
var originalStyle2 = bMapModel.__mapStyle2;
|
||||||
|
var newMapStyle2 = bMapModel.get('mapStyleV2') || {};
|
||||||
|
// FIXME, Not use JSON methods
|
||||||
|
var mapStyleStr2 = JSON.stringify(newMapStyle2);
|
||||||
|
if (JSON.stringify(originalStyle2) !== mapStyleStr2) {
|
||||||
|
// FIXME May have blank tile when dragging if setMapStyle
|
||||||
|
if (!isEmptyObject(newMapStyle2)) {
|
||||||
|
bmap.setMapStyleV2(zrUtil.clone(newMapStyle2));
|
||||||
|
}
|
||||||
|
bMapModel.__mapStyle2 = JSON.parse(mapStyleStr2);
|
||||||
|
}
|
||||||
|
rendering = false;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
extendComponentView(proto);
|
||||||
+63
@@ -0,0 +1,63 @@
|
|||||||
|
|
||||||
|
/*
|
||||||
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
* distributed with this work for additional information
|
||||||
|
* regarding copyright ownership. The ASF licenses this file
|
||||||
|
* to you under the Apache License, Version 2.0 (the
|
||||||
|
* "License"); you may not use this file except in compliance
|
||||||
|
* with the License. You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing,
|
||||||
|
* software distributed under the License is distributed on an
|
||||||
|
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||||
|
* KIND, either express or implied. See the License for the
|
||||||
|
* specific language governing permissions and limitations
|
||||||
|
* under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* AUTO-GENERATED FILE. DO NOT MODIFY.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
* distributed with this work for additional information
|
||||||
|
* regarding copyright ownership. The ASF licenses this file
|
||||||
|
* to you under the Apache License, Version 2.0 (the
|
||||||
|
* "License"); you may not use this file except in compliance
|
||||||
|
* with the License. You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing,
|
||||||
|
* software distributed under the License is distributed on an
|
||||||
|
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||||
|
* KIND, either express or implied. See the License for the
|
||||||
|
* specific language governing permissions and limitations
|
||||||
|
* under the License.
|
||||||
|
*/
|
||||||
|
/**
|
||||||
|
* BMap component extension
|
||||||
|
*/
|
||||||
|
import * as echarts from 'echarts';
|
||||||
|
import './BMapCoordSys.js';
|
||||||
|
import { COMPONENT_MAIN_TYPE_BMAP } from './BMapModel.js';
|
||||||
|
import './BMapView.js';
|
||||||
|
// Action
|
||||||
|
echarts.registerAction({
|
||||||
|
type: 'bmapRoam',
|
||||||
|
event: 'bmapRoam',
|
||||||
|
update: 'updateLayout'
|
||||||
|
}, function (payload, ecModel) {
|
||||||
|
ecModel.eachComponent(COMPONENT_MAIN_TYPE_BMAP, function (bMapModel) {
|
||||||
|
var bmap = bMapModel.getBMap();
|
||||||
|
var center = bmap.getCenter();
|
||||||
|
bMapModel.setCenterAndZoom([center.lng, center.lat], bmap.getZoom());
|
||||||
|
});
|
||||||
|
});
|
||||||
|
export var version = '1.0.0';
|
||||||
+202
@@ -0,0 +1,202 @@
|
|||||||
|
|
||||||
|
/*
|
||||||
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
* distributed with this work for additional information
|
||||||
|
* regarding copyright ownership. The ASF licenses this file
|
||||||
|
* to you under the Apache License, Version 2.0 (the
|
||||||
|
* "License"); you may not use this file except in compliance
|
||||||
|
* with the License. You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing,
|
||||||
|
* software distributed under the License is distributed on an
|
||||||
|
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||||
|
* KIND, either express or implied. See the License for the
|
||||||
|
* specific language governing permissions and limitations
|
||||||
|
* under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* AUTO-GENERATED FILE. DO NOT MODIFY.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
* distributed with this work for additional information
|
||||||
|
* regarding copyright ownership. The ASF licenses this file
|
||||||
|
* to you under the Apache License, Version 2.0 (the
|
||||||
|
* "License"); you may not use this file except in compliance
|
||||||
|
* with the License. You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing,
|
||||||
|
* software distributed under the License is distributed on an
|
||||||
|
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||||
|
* KIND, either express or implied. See the License for the
|
||||||
|
* specific language governing permissions and limitations
|
||||||
|
* under the License.
|
||||||
|
*/
|
||||||
|
// @ts-nocheck
|
||||||
|
/**
|
||||||
|
* This is a parse of GEXF.
|
||||||
|
*
|
||||||
|
* The spec of GEXF:
|
||||||
|
* https://gephi.org/gexf/1.2draft/gexf-12draft-primer.pdf
|
||||||
|
*/
|
||||||
|
import * as zrUtil from 'zrender/lib/core/util.js';
|
||||||
|
export function parse(xml) {
|
||||||
|
var doc;
|
||||||
|
if (typeof xml === 'string') {
|
||||||
|
var parser = new DOMParser();
|
||||||
|
doc = parser.parseFromString(xml, 'text/xml');
|
||||||
|
} else {
|
||||||
|
doc = xml;
|
||||||
|
}
|
||||||
|
if (!doc || doc.getElementsByTagName('parsererror').length) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
var gexfRoot = getChildByTagName(doc, 'gexf');
|
||||||
|
if (!gexfRoot) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
var graphRoot = getChildByTagName(gexfRoot, 'graph');
|
||||||
|
var attributes = parseAttributes(getChildByTagName(graphRoot, 'attributes'));
|
||||||
|
var attributesMap = {};
|
||||||
|
for (var i = 0; i < attributes.length; i++) {
|
||||||
|
attributesMap[attributes[i].id] = attributes[i];
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
nodes: parseNodes(getChildByTagName(graphRoot, 'nodes'), attributesMap),
|
||||||
|
links: parseEdges(getChildByTagName(graphRoot, 'edges'))
|
||||||
|
};
|
||||||
|
}
|
||||||
|
function parseAttributes(parent) {
|
||||||
|
return parent ? zrUtil.map(getChildrenByTagName(parent, 'attribute'), function (attribDom) {
|
||||||
|
return {
|
||||||
|
id: getAttr(attribDom, 'id'),
|
||||||
|
title: getAttr(attribDom, 'title'),
|
||||||
|
type: getAttr(attribDom, 'type')
|
||||||
|
};
|
||||||
|
}) : [];
|
||||||
|
}
|
||||||
|
function parseNodes(parent, attributesMap) {
|
||||||
|
return parent ? zrUtil.map(getChildrenByTagName(parent, 'node'), function (nodeDom) {
|
||||||
|
var id = getAttr(nodeDom, 'id');
|
||||||
|
var label = getAttr(nodeDom, 'label');
|
||||||
|
var node = {
|
||||||
|
id: id,
|
||||||
|
name: label,
|
||||||
|
itemStyle: {
|
||||||
|
normal: {}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
var vizSizeDom = getChildByTagName(nodeDom, 'viz:size');
|
||||||
|
var vizPosDom = getChildByTagName(nodeDom, 'viz:position');
|
||||||
|
var vizColorDom = getChildByTagName(nodeDom, 'viz:color');
|
||||||
|
// let vizShapeDom = getChildByTagName(nodeDom, 'viz:shape');
|
||||||
|
var attvaluesDom = getChildByTagName(nodeDom, 'attvalues');
|
||||||
|
if (vizSizeDom) {
|
||||||
|
node.symbolSize = parseFloat(getAttr(vizSizeDom, 'value'));
|
||||||
|
}
|
||||||
|
if (vizPosDom) {
|
||||||
|
node.x = parseFloat(getAttr(vizPosDom, 'x'));
|
||||||
|
node.y = parseFloat(getAttr(vizPosDom, 'y'));
|
||||||
|
// z
|
||||||
|
}
|
||||||
|
if (vizColorDom) {
|
||||||
|
node.itemStyle.normal.color = 'rgb(' + [getAttr(vizColorDom, 'r') | 0, getAttr(vizColorDom, 'g') | 0, getAttr(vizColorDom, 'b') | 0].join(',') + ')';
|
||||||
|
}
|
||||||
|
// if (vizShapeDom) {
|
||||||
|
// node.shape = getAttr(vizShapeDom, 'shape');
|
||||||
|
// }
|
||||||
|
if (attvaluesDom) {
|
||||||
|
var attvalueDomList = getChildrenByTagName(attvaluesDom, 'attvalue');
|
||||||
|
node.attributes = {};
|
||||||
|
for (var j = 0; j < attvalueDomList.length; j++) {
|
||||||
|
var attvalueDom = attvalueDomList[j];
|
||||||
|
var attId = getAttr(attvalueDom, 'for');
|
||||||
|
var attValue = getAttr(attvalueDom, 'value');
|
||||||
|
var attribute = attributesMap[attId];
|
||||||
|
if (attribute) {
|
||||||
|
switch (attribute.type) {
|
||||||
|
case 'integer':
|
||||||
|
case 'long':
|
||||||
|
attValue = parseInt(attValue, 10);
|
||||||
|
break;
|
||||||
|
case 'float':
|
||||||
|
case 'double':
|
||||||
|
attValue = parseFloat(attValue);
|
||||||
|
break;
|
||||||
|
case 'boolean':
|
||||||
|
attValue = attValue.toLowerCase() === 'true';
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
}
|
||||||
|
node.attributes[attId] = attValue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return node;
|
||||||
|
}) : [];
|
||||||
|
}
|
||||||
|
function parseEdges(parent) {
|
||||||
|
return parent ? zrUtil.map(getChildrenByTagName(parent, 'edge'), function (edgeDom) {
|
||||||
|
var id = getAttr(edgeDom, 'id');
|
||||||
|
var label = getAttr(edgeDom, 'label');
|
||||||
|
var sourceId = getAttr(edgeDom, 'source');
|
||||||
|
var targetId = getAttr(edgeDom, 'target');
|
||||||
|
var edge = {
|
||||||
|
id: id,
|
||||||
|
name: label,
|
||||||
|
source: sourceId,
|
||||||
|
target: targetId,
|
||||||
|
lineStyle: {
|
||||||
|
normal: {}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
var lineStyle = edge.lineStyle.normal;
|
||||||
|
var vizThicknessDom = getChildByTagName(edgeDom, 'viz:thickness');
|
||||||
|
var vizColorDom = getChildByTagName(edgeDom, 'viz:color');
|
||||||
|
// let vizShapeDom = getChildByTagName(edgeDom, 'viz:shape');
|
||||||
|
if (vizThicknessDom) {
|
||||||
|
lineStyle.width = parseFloat(vizThicknessDom.getAttribute('value'));
|
||||||
|
}
|
||||||
|
if (vizColorDom) {
|
||||||
|
lineStyle.color = 'rgb(' + [getAttr(vizColorDom, 'r') | 0, getAttr(vizColorDom, 'g') | 0, getAttr(vizColorDom, 'b') | 0].join(',') + ')';
|
||||||
|
}
|
||||||
|
// if (vizShapeDom) {
|
||||||
|
// edge.shape = vizShapeDom.getAttribute('shape');
|
||||||
|
// }
|
||||||
|
return edge;
|
||||||
|
}) : [];
|
||||||
|
}
|
||||||
|
function getAttr(el, attrName) {
|
||||||
|
return el.getAttribute(attrName);
|
||||||
|
}
|
||||||
|
function getChildByTagName(parent, tagName) {
|
||||||
|
var node = parent.firstChild;
|
||||||
|
while (node) {
|
||||||
|
if (node.nodeType !== 1 || node.nodeName.toLowerCase() !== tagName.toLowerCase()) {
|
||||||
|
node = node.nextSibling;
|
||||||
|
} else {
|
||||||
|
return node;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
function getChildrenByTagName(parent, tagName) {
|
||||||
|
var node = parent.firstChild;
|
||||||
|
var children = [];
|
||||||
|
while (node) {
|
||||||
|
if (node.nodeName.toLowerCase() === tagName.toLowerCase()) {
|
||||||
|
children.push(node);
|
||||||
|
}
|
||||||
|
node = node.nextSibling;
|
||||||
|
}
|
||||||
|
return children;
|
||||||
|
}
|
||||||
+62
@@ -0,0 +1,62 @@
|
|||||||
|
|
||||||
|
/*
|
||||||
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
* distributed with this work for additional information
|
||||||
|
* regarding copyright ownership. The ASF licenses this file
|
||||||
|
* to you under the Apache License, Version 2.0 (the
|
||||||
|
* "License"); you may not use this file except in compliance
|
||||||
|
* with the License. You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing,
|
||||||
|
* software distributed under the License is distributed on an
|
||||||
|
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||||
|
* KIND, either express or implied. See the License for the
|
||||||
|
* specific language governing permissions and limitations
|
||||||
|
* under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* AUTO-GENERATED FILE. DO NOT MODIFY.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
* distributed with this work for additional information
|
||||||
|
* regarding copyright ownership. The ASF licenses this file
|
||||||
|
* to you under the Apache License, Version 2.0 (the
|
||||||
|
* "License"); you may not use this file except in compliance
|
||||||
|
* with the License. You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing,
|
||||||
|
* software distributed under the License is distributed on an
|
||||||
|
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||||
|
* KIND, either express or implied. See the License for the
|
||||||
|
* specific language governing permissions and limitations
|
||||||
|
* under the License.
|
||||||
|
*/
|
||||||
|
// @ts-nocheck
|
||||||
|
import * as echarts from 'echarts';
|
||||||
|
import * as gexf from './gexf.js';
|
||||||
|
import prepareBoxplotData from './prepareBoxplotData.js';
|
||||||
|
// import { boxplotTransform } from './boxplotTransform.js';
|
||||||
|
export var version = '1.0.0';
|
||||||
|
export { gexf };
|
||||||
|
export { prepareBoxplotData };
|
||||||
|
// export {boxplotTransform};
|
||||||
|
// For backward compatibility, where the namespace `dataTool` will
|
||||||
|
// be mounted on `echarts` is the extension `dataTool` is imported.
|
||||||
|
// But the old version of echarts do not have `dataTool` namespace,
|
||||||
|
// so check it before mounting.
|
||||||
|
if (echarts.dataTool) {
|
||||||
|
echarts.dataTool.version = version;
|
||||||
|
echarts.dataTool.gexf = gexf;
|
||||||
|
echarts.dataTool.prepareBoxplotData = prepareBoxplotData;
|
||||||
|
// echarts.dataTool.boxplotTransform = boxplotTransform;
|
||||||
|
}
|
||||||
+116
@@ -0,0 +1,116 @@
|
|||||||
|
|
||||||
|
/*
|
||||||
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
* distributed with this work for additional information
|
||||||
|
* regarding copyright ownership. The ASF licenses this file
|
||||||
|
* to you under the Apache License, Version 2.0 (the
|
||||||
|
* "License"); you may not use this file except in compliance
|
||||||
|
* with the License. You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing,
|
||||||
|
* software distributed under the License is distributed on an
|
||||||
|
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||||
|
* KIND, either express or implied. See the License for the
|
||||||
|
* specific language governing permissions and limitations
|
||||||
|
* under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* AUTO-GENERATED FILE. DO NOT MODIFY.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
* distributed with this work for additional information
|
||||||
|
* regarding copyright ownership. The ASF licenses this file
|
||||||
|
* to you under the Apache License, Version 2.0 (the
|
||||||
|
* "License"); you may not use this file except in compliance
|
||||||
|
* with the License. You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing,
|
||||||
|
* software distributed under the License is distributed on an
|
||||||
|
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||||
|
* KIND, either express or implied. See the License for the
|
||||||
|
* specific language governing permissions and limitations
|
||||||
|
* under the License.
|
||||||
|
*/
|
||||||
|
function asc(arr) {
|
||||||
|
arr.sort(function (a, b) {
|
||||||
|
return a - b;
|
||||||
|
});
|
||||||
|
return arr;
|
||||||
|
}
|
||||||
|
function quantile(ascArr, p) {
|
||||||
|
var H = (ascArr.length - 1) * p + 1;
|
||||||
|
var h = Math.floor(H);
|
||||||
|
var v = +ascArr[h - 1];
|
||||||
|
var e = H - h;
|
||||||
|
return e ? v + e * (ascArr[h] - v) : v;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* See:
|
||||||
|
* <https://en.wikipedia.org/wiki/Box_plot#cite_note-frigge_hoaglin_iglewicz-2>
|
||||||
|
* <http://stat.ethz.ch/R-manual/R-devel/library/grDevices/html/boxplot.stats.html>
|
||||||
|
*
|
||||||
|
* Helper method for preparing data.
|
||||||
|
*
|
||||||
|
* @param {Array.<number>} rawData like
|
||||||
|
* [
|
||||||
|
* [12,232,443], (raw data set for the first box)
|
||||||
|
* [3843,5545,1232], (raw data set for the second box)
|
||||||
|
* ...
|
||||||
|
* ]
|
||||||
|
* @param {Object} [opt]
|
||||||
|
*
|
||||||
|
* @param {(number|string)} [opt.boundIQR=1.5] Data less than min bound is outlier.
|
||||||
|
* default 1.5, means Q1 - 1.5 * (Q3 - Q1).
|
||||||
|
* If 'none'/0 passed, min bound will not be used.
|
||||||
|
* @param {(number|string)} [opt.layout='horizontal']
|
||||||
|
* Box plot layout, can be 'horizontal' or 'vertical'
|
||||||
|
* @return {Object} {
|
||||||
|
* boxData: Array.<Array.<number>>
|
||||||
|
* outliers: Array.<Array.<number>>
|
||||||
|
* axisData: Array.<string>
|
||||||
|
* }
|
||||||
|
*/
|
||||||
|
export default function (rawData, opt) {
|
||||||
|
opt = opt || {};
|
||||||
|
var boxData = [];
|
||||||
|
var outliers = [];
|
||||||
|
var axisData = [];
|
||||||
|
var boundIQR = opt.boundIQR;
|
||||||
|
var useExtreme = boundIQR === 'none' || boundIQR === 0;
|
||||||
|
for (var i = 0; i < rawData.length; i++) {
|
||||||
|
axisData.push(i + '');
|
||||||
|
var ascList = asc(rawData[i].slice());
|
||||||
|
var Q1 = quantile(ascList, 0.25);
|
||||||
|
var Q2 = quantile(ascList, 0.5);
|
||||||
|
var Q3 = quantile(ascList, 0.75);
|
||||||
|
var min = ascList[0];
|
||||||
|
var max = ascList[ascList.length - 1];
|
||||||
|
var bound = (boundIQR == null ? 1.5 : boundIQR) * (Q3 - Q1);
|
||||||
|
var low = useExtreme ? min : Math.max(min, Q1 - bound);
|
||||||
|
var high = useExtreme ? max : Math.min(max, Q3 + bound);
|
||||||
|
boxData.push([low, Q1, Q2, Q3, high]);
|
||||||
|
for (var j = 0; j < ascList.length; j++) {
|
||||||
|
var dataItem = ascList[j];
|
||||||
|
if (dataItem < low || dataItem > high) {
|
||||||
|
var outlier = [i, dataItem];
|
||||||
|
opt.layout === 'vertical' && outlier.reverse();
|
||||||
|
outliers.push(outlier);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
boxData: boxData,
|
||||||
|
outliers: outliers,
|
||||||
|
axisData: axisData
|
||||||
|
};
|
||||||
|
}
|
||||||
+22
@@ -0,0 +1,22 @@
|
|||||||
|
/*
|
||||||
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
* distributed with this work for additional information
|
||||||
|
* regarding copyright ownership. The ASF licenses this file
|
||||||
|
* to you under the Apache License, Version 2.0 (the
|
||||||
|
* "License"); you may not use this file except in compliance
|
||||||
|
* with the License. You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing,
|
||||||
|
* software distributed under the License is distributed on an
|
||||||
|
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||||
|
* KIND, either express or implied. See the License for the
|
||||||
|
* specific language governing permissions and limitations
|
||||||
|
* under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
// A pseudo `.js` to redirect to `.d.ts`.
|
||||||
|
export * from './types/dist/features.js';
|
||||||
|
// See section "TypeScript entries" in `echarts/package.README.md` for more details.
|
||||||
+20
@@ -0,0 +1,20 @@
|
|||||||
|
/*
|
||||||
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
* distributed with this work for additional information
|
||||||
|
* regarding copyright ownership. The ASF licenses this file
|
||||||
|
* to you under the Apache License, Version 2.0 (the
|
||||||
|
* "License"); you may not use this file except in compliance
|
||||||
|
* with the License. You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing,
|
||||||
|
* software distributed under the License is distributed on an
|
||||||
|
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||||
|
* KIND, either express or implied. See the License for the
|
||||||
|
* specific language governing permissions and limitations
|
||||||
|
* under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
export * from './lib/export/features.js';
|
||||||
+178
@@ -0,0 +1,178 @@
|
|||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
* distributed with this work for additional information
|
||||||
|
* regarding copyright ownership. The ASF licenses this file
|
||||||
|
* to you under the Apache License, Version 2.0 (the
|
||||||
|
* "License"); you may not use this file except in compliance
|
||||||
|
* with the License. You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing,
|
||||||
|
* software distributed under the License is distributed on an
|
||||||
|
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||||
|
* KIND, either express or implied. See the License for the
|
||||||
|
* specific language governing permissions and limitations
|
||||||
|
* under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* AUTO-GENERATED FILE. DO NOT MODIFY.
|
||||||
|
*/
|
||||||
|
(function(root, factory) {
|
||||||
|
if (typeof define === 'function' && define.amd) {
|
||||||
|
// AMD. Register as an anonymous module.
|
||||||
|
define(['exports'], factory);
|
||||||
|
} else if (
|
||||||
|
typeof exports === 'object' &&
|
||||||
|
typeof exports.nodeName !== 'string'
|
||||||
|
) {
|
||||||
|
// CommonJS
|
||||||
|
factory(exports);
|
||||||
|
} else {
|
||||||
|
// Browser globals
|
||||||
|
factory({});
|
||||||
|
}
|
||||||
|
})(this, function(exports) {
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Language: Arabic.
|
||||||
|
*/
|
||||||
|
|
||||||
|
var localeObj = {
|
||||||
|
|
||||||
|
time: {
|
||||||
|
month: [
|
||||||
|
'يناير', 'فبراير', 'مارس', 'أبريل', 'مايو', 'يونيو',
|
||||||
|
'يوليو', 'أغسطس', 'سبتمبر', 'أكتوبر', 'نوفمبر', 'ديسمبر'
|
||||||
|
],
|
||||||
|
monthAbbr: [
|
||||||
|
'يناير', 'فبراير', 'مارس', 'أبريل', 'مايو', 'يونيو',
|
||||||
|
'يوليو', 'أغسطس', 'سبتمبر', 'أكتوبر', 'نوفمبر', 'ديسمبر'
|
||||||
|
],
|
||||||
|
dayOfWeek: [
|
||||||
|
'الأحد', 'الإثنين', 'الثلاثاء', 'الأربعاء', 'الخميس', 'الجمعة', 'السبت'
|
||||||
|
],
|
||||||
|
dayOfWeekAbbr: [
|
||||||
|
'الأحد', 'الإثنين', 'الثلاثاء', 'الأربعاء', 'الخميس', 'الجمعة', 'السبت'
|
||||||
|
]
|
||||||
|
},
|
||||||
|
legend: {
|
||||||
|
selector: {
|
||||||
|
all: 'تحديد الكل',
|
||||||
|
inverse: 'عكس التحديد'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
toolbox: {
|
||||||
|
brush: {
|
||||||
|
title: {
|
||||||
|
rect: 'تحديد صندوقي',
|
||||||
|
polygon: 'تحديد حلقي',
|
||||||
|
lineX: 'تحديد أفقي',
|
||||||
|
lineY: 'تحديد عمودي',
|
||||||
|
keep: 'الاحتفاظ بالمحدد',
|
||||||
|
clear: 'إلغاء التحديد'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
dataView: {
|
||||||
|
title: 'عرض البيانات',
|
||||||
|
lang: ['عرض البيانات', 'إغلاق', 'تحديث']
|
||||||
|
},
|
||||||
|
dataZoom: {
|
||||||
|
title: {
|
||||||
|
zoom: 'تكبير',
|
||||||
|
back: 'استعادة التكبير'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
magicType: {
|
||||||
|
title: {
|
||||||
|
line: 'خطوط',
|
||||||
|
bar: 'أشرطة',
|
||||||
|
stack: 'تكديس',
|
||||||
|
tiled: 'مربعات'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
restore: {
|
||||||
|
title: 'استعادة'
|
||||||
|
},
|
||||||
|
saveAsImage: {
|
||||||
|
title: 'حفظ كملف صورة',
|
||||||
|
lang: ['للحفظ كصورة انقر بالزر الأيمن']
|
||||||
|
}
|
||||||
|
},
|
||||||
|
series: {
|
||||||
|
typeNames: {
|
||||||
|
pie: 'رسم بياني دائري',
|
||||||
|
bar: 'رسم بياني شريطي',
|
||||||
|
line: 'رسم بياني خطي',
|
||||||
|
scatter: 'نقاط مبعثرة',
|
||||||
|
effectScatter: 'نقاط مبعثرة متموجة',
|
||||||
|
radar: 'رسم بياني راداري',
|
||||||
|
tree: 'شجرة',
|
||||||
|
treemap: 'مخطط شجري',
|
||||||
|
boxplot: 'مخطط صندوقي',
|
||||||
|
candlestick: 'مخطط شمعدان',
|
||||||
|
k: 'رسم بياني خطي من النوع K',
|
||||||
|
heatmap: 'خريطة حرارية',
|
||||||
|
map: 'خريطة',
|
||||||
|
parallel: 'خريطة الإحداثيات المتناظرة',
|
||||||
|
lines: 'خطوط',
|
||||||
|
graph: 'مخطط علائقي',
|
||||||
|
sankey: 'مخطط ثعباني',
|
||||||
|
funnel: 'مخطط هرمي',
|
||||||
|
gauge: 'مقياس',
|
||||||
|
pictorialBar: 'مخطط مصوّر',
|
||||||
|
themeRiver: 'نمط خريطة النهر',
|
||||||
|
sunburst: 'مخطط شمسي',
|
||||||
|
custom: 'مخطط مخصص',
|
||||||
|
chart: 'مخطط'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
aria: {
|
||||||
|
general: {
|
||||||
|
withTitle: 'هذا رسم بياني حول "{title}".',
|
||||||
|
withoutTitle: 'هذا رسم بياني.'
|
||||||
|
},
|
||||||
|
series: {
|
||||||
|
single: {
|
||||||
|
prefix: '',
|
||||||
|
withName: ' من النوع {seriesType} اسمه {seriesName}.',
|
||||||
|
withoutName: ' من النوع {seriesType}.'
|
||||||
|
},
|
||||||
|
multiple: {
|
||||||
|
prefix: '. يتكون من {seriesCount} سلسلة.',
|
||||||
|
withName: ' الـ {seriesId} هي سلسلة من النوع {seriesType} تستعرض {seriesName}.',
|
||||||
|
withoutName: ' الـ {seriesId} هي سلسلة من النوع {seriesType}.',
|
||||||
|
separator: {
|
||||||
|
middle: '، ',
|
||||||
|
end: '. '
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data: {
|
||||||
|
allData: 'البيانات هي كالتالي: ',
|
||||||
|
partialData: 'أول {displayCnt} عناصر هي: ',
|
||||||
|
withName: 'قيمة العنصر {name} هي {value}',
|
||||||
|
withoutName: '{value}',
|
||||||
|
separator: {
|
||||||
|
middle: '، ',
|
||||||
|
end: '. '
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
for (var key in localeObj) {
|
||||||
|
if (localeObj.hasOwnProperty(key)) {
|
||||||
|
exports[key] = localeObj[key];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
+174
@@ -0,0 +1,174 @@
|
|||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
* distributed with this work for additional information
|
||||||
|
* regarding copyright ownership. The ASF licenses this file
|
||||||
|
* to you under the Apache License, Version 2.0 (the
|
||||||
|
* "License"); you may not use this file except in compliance
|
||||||
|
* with the License. You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing,
|
||||||
|
* software distributed under the License is distributed on an
|
||||||
|
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||||
|
* KIND, either express or implied. See the License for the
|
||||||
|
* specific language governing permissions and limitations
|
||||||
|
* under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* AUTO-GENERATED FILE. DO NOT MODIFY.
|
||||||
|
*/
|
||||||
|
(function(root, factory) {
|
||||||
|
if (typeof define === 'function' && define.amd) {
|
||||||
|
// AMD. Register as an anonymous module.
|
||||||
|
define(['exports', 'echarts'], factory);
|
||||||
|
} else if (
|
||||||
|
typeof exports === 'object' &&
|
||||||
|
typeof exports.nodeName !== 'string'
|
||||||
|
) {
|
||||||
|
// CommonJS
|
||||||
|
factory(exports, require('echarts/lib/echarts'));
|
||||||
|
} else {
|
||||||
|
// Browser globals
|
||||||
|
factory({}, root.echarts);
|
||||||
|
}
|
||||||
|
})(this, function(exports, echarts) {
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Language: Arabic.
|
||||||
|
*/
|
||||||
|
|
||||||
|
var localeObj = {
|
||||||
|
|
||||||
|
time: {
|
||||||
|
month: [
|
||||||
|
'يناير', 'فبراير', 'مارس', 'أبريل', 'مايو', 'يونيو',
|
||||||
|
'يوليو', 'أغسطس', 'سبتمبر', 'أكتوبر', 'نوفمبر', 'ديسمبر'
|
||||||
|
],
|
||||||
|
monthAbbr: [
|
||||||
|
'يناير', 'فبراير', 'مارس', 'أبريل', 'مايو', 'يونيو',
|
||||||
|
'يوليو', 'أغسطس', 'سبتمبر', 'أكتوبر', 'نوفمبر', 'ديسمبر'
|
||||||
|
],
|
||||||
|
dayOfWeek: [
|
||||||
|
'الأحد', 'الإثنين', 'الثلاثاء', 'الأربعاء', 'الخميس', 'الجمعة', 'السبت'
|
||||||
|
],
|
||||||
|
dayOfWeekAbbr: [
|
||||||
|
'الأحد', 'الإثنين', 'الثلاثاء', 'الأربعاء', 'الخميس', 'الجمعة', 'السبت'
|
||||||
|
]
|
||||||
|
},
|
||||||
|
legend: {
|
||||||
|
selector: {
|
||||||
|
all: 'تحديد الكل',
|
||||||
|
inverse: 'عكس التحديد'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
toolbox: {
|
||||||
|
brush: {
|
||||||
|
title: {
|
||||||
|
rect: 'تحديد صندوقي',
|
||||||
|
polygon: 'تحديد حلقي',
|
||||||
|
lineX: 'تحديد أفقي',
|
||||||
|
lineY: 'تحديد عمودي',
|
||||||
|
keep: 'الاحتفاظ بالمحدد',
|
||||||
|
clear: 'إلغاء التحديد'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
dataView: {
|
||||||
|
title: 'عرض البيانات',
|
||||||
|
lang: ['عرض البيانات', 'إغلاق', 'تحديث']
|
||||||
|
},
|
||||||
|
dataZoom: {
|
||||||
|
title: {
|
||||||
|
zoom: 'تكبير',
|
||||||
|
back: 'استعادة التكبير'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
magicType: {
|
||||||
|
title: {
|
||||||
|
line: 'خطوط',
|
||||||
|
bar: 'أشرطة',
|
||||||
|
stack: 'تكديس',
|
||||||
|
tiled: 'مربعات'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
restore: {
|
||||||
|
title: 'استعادة'
|
||||||
|
},
|
||||||
|
saveAsImage: {
|
||||||
|
title: 'حفظ كملف صورة',
|
||||||
|
lang: ['للحفظ كصورة انقر بالزر الأيمن']
|
||||||
|
}
|
||||||
|
},
|
||||||
|
series: {
|
||||||
|
typeNames: {
|
||||||
|
pie: 'رسم بياني دائري',
|
||||||
|
bar: 'رسم بياني شريطي',
|
||||||
|
line: 'رسم بياني خطي',
|
||||||
|
scatter: 'نقاط مبعثرة',
|
||||||
|
effectScatter: 'نقاط مبعثرة متموجة',
|
||||||
|
radar: 'رسم بياني راداري',
|
||||||
|
tree: 'شجرة',
|
||||||
|
treemap: 'مخطط شجري',
|
||||||
|
boxplot: 'مخطط صندوقي',
|
||||||
|
candlestick: 'مخطط شمعدان',
|
||||||
|
k: 'رسم بياني خطي من النوع K',
|
||||||
|
heatmap: 'خريطة حرارية',
|
||||||
|
map: 'خريطة',
|
||||||
|
parallel: 'خريطة الإحداثيات المتناظرة',
|
||||||
|
lines: 'خطوط',
|
||||||
|
graph: 'مخطط علائقي',
|
||||||
|
sankey: 'مخطط ثعباني',
|
||||||
|
funnel: 'مخطط هرمي',
|
||||||
|
gauge: 'مقياس',
|
||||||
|
pictorialBar: 'مخطط مصوّر',
|
||||||
|
themeRiver: 'نمط خريطة النهر',
|
||||||
|
sunburst: 'مخطط شمسي',
|
||||||
|
custom: 'مخطط مخصص',
|
||||||
|
chart: 'مخطط'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
aria: {
|
||||||
|
general: {
|
||||||
|
withTitle: 'هذا رسم بياني حول "{title}".',
|
||||||
|
withoutTitle: 'هذا رسم بياني.'
|
||||||
|
},
|
||||||
|
series: {
|
||||||
|
single: {
|
||||||
|
prefix: '',
|
||||||
|
withName: ' من النوع {seriesType} اسمه {seriesName}.',
|
||||||
|
withoutName: ' من النوع {seriesType}.'
|
||||||
|
},
|
||||||
|
multiple: {
|
||||||
|
prefix: '. يتكون من {seriesCount} سلسلة.',
|
||||||
|
withName: ' الـ {seriesId} هي سلسلة من النوع {seriesType} تستعرض {seriesName}.',
|
||||||
|
withoutName: ' الـ {seriesId} هي سلسلة من النوع {seriesType}.',
|
||||||
|
separator: {
|
||||||
|
middle: '، ',
|
||||||
|
end: '. '
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data: {
|
||||||
|
allData: 'البيانات هي كالتالي: ',
|
||||||
|
partialData: 'أول {displayCnt} عناصر هي: ',
|
||||||
|
withName: 'قيمة العنصر {name} هي {value}',
|
||||||
|
withoutName: '{value}',
|
||||||
|
separator: {
|
||||||
|
middle: '، ',
|
||||||
|
end: '. '
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
echarts.registerLocale('AR', localeObj);
|
||||||
|
|
||||||
|
});
|
||||||
+175
@@ -0,0 +1,175 @@
|
|||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
* distributed with this work for additional information
|
||||||
|
* regarding copyright ownership. The ASF licenses this file
|
||||||
|
* to you under the Apache License, Version 2.0 (the
|
||||||
|
* "License"); you may not use this file except in compliance
|
||||||
|
* with the License. You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing,
|
||||||
|
* software distributed under the License is distributed on an
|
||||||
|
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||||
|
* KIND, either express or implied. See the License for the
|
||||||
|
* specific language governing permissions and limitations
|
||||||
|
* under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* AUTO-GENERATED FILE. DO NOT MODIFY.
|
||||||
|
*/
|
||||||
|
(function(root, factory) {
|
||||||
|
if (typeof define === 'function' && define.amd) {
|
||||||
|
// AMD. Register as an anonymous module.
|
||||||
|
define(['exports'], factory);
|
||||||
|
} else if (
|
||||||
|
typeof exports === 'object' &&
|
||||||
|
typeof exports.nodeName !== 'string'
|
||||||
|
) {
|
||||||
|
// CommonJS
|
||||||
|
factory(exports);
|
||||||
|
} else {
|
||||||
|
// Browser globals
|
||||||
|
factory({});
|
||||||
|
}
|
||||||
|
})(this, function(exports) {
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Language: Czech.
|
||||||
|
*/
|
||||||
|
|
||||||
|
var localeObj = {
|
||||||
|
time: {
|
||||||
|
month: [
|
||||||
|
'Leden', 'Únor', 'Březen', 'Duben', 'Květen', 'Červen',
|
||||||
|
'Červenec', 'Srpen', 'Září', 'Říjen', 'Listopad', 'Prosinec'
|
||||||
|
],
|
||||||
|
monthAbbr: [
|
||||||
|
'Led', 'Úno', 'Bře', 'Dub', 'Kvě', 'Čvn',
|
||||||
|
'Čvc', 'Srp', 'Zář', 'Říj', 'Lis', 'Pro'
|
||||||
|
],
|
||||||
|
dayOfWeek: [
|
||||||
|
'Neděle', 'Pondělí', 'Úterý', 'Středa', 'Čtvrtek', 'Pátek', 'Sobota'
|
||||||
|
],
|
||||||
|
dayOfWeekAbbr: [
|
||||||
|
'Ne', 'Po', 'Út', 'St', 'Čt', 'Pá', 'So'
|
||||||
|
]
|
||||||
|
},
|
||||||
|
legend: {
|
||||||
|
selector: {
|
||||||
|
all: 'Vše',
|
||||||
|
inverse: 'Inv'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
toolbox: {
|
||||||
|
brush: {
|
||||||
|
title: {
|
||||||
|
rect: 'Obdélníkový výběr',
|
||||||
|
polygon: 'Lasso výběr',
|
||||||
|
lineX: 'Horizontální výběr',
|
||||||
|
lineY: 'Vertikální výběr',
|
||||||
|
keep: 'Ponechat výběr',
|
||||||
|
clear: 'Zrušit výběr'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
dataView: {
|
||||||
|
title: 'Data',
|
||||||
|
lang: ['Data', 'Zavřít', 'Obnovit']
|
||||||
|
},
|
||||||
|
dataZoom: {
|
||||||
|
title: {
|
||||||
|
zoom: 'Přiblížit',
|
||||||
|
back: 'Oddálit'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
magicType: {
|
||||||
|
title: {
|
||||||
|
line: 'Změnit na Spojnicový graf',
|
||||||
|
bar: 'Změnit na Sloupcový graf',
|
||||||
|
stack: 'Plošný',
|
||||||
|
tiled: 'Tile'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
restore: {
|
||||||
|
title: 'Obnovit'
|
||||||
|
},
|
||||||
|
saveAsImage: {
|
||||||
|
title: 'Uložit jako obrázek',
|
||||||
|
lang: ['Obrázek uložte pravým kliknutím']
|
||||||
|
}
|
||||||
|
},
|
||||||
|
series: {
|
||||||
|
typeNames: {
|
||||||
|
pie: 'Výsečový graf',
|
||||||
|
bar: 'Sloupcový graf',
|
||||||
|
line: 'Spojnicový graf',
|
||||||
|
scatter: 'XY bodový graf',
|
||||||
|
effectScatter: 'Effect XY bodový graf',
|
||||||
|
radar: 'Paprskový graf',
|
||||||
|
tree: 'Strom',
|
||||||
|
treemap: 'Stromová mapa',
|
||||||
|
boxplot: 'Krabicový graf',
|
||||||
|
candlestick: 'Burzovní graf',
|
||||||
|
k: 'K spojnicový graf',
|
||||||
|
heatmap: 'Teplotní mapa',
|
||||||
|
map: 'Mapa',
|
||||||
|
parallel: 'Rovnoběžné souřadnice',
|
||||||
|
lines: 'Spojnicový graf',
|
||||||
|
graph: 'Graf vztahů',
|
||||||
|
sankey: 'Sankeyův diagram',
|
||||||
|
funnel: 'Trychtýř (Funnel)',
|
||||||
|
gauge: 'Indikátor',
|
||||||
|
pictorialBar: 'Obrázkový sloupcový graf',
|
||||||
|
themeRiver: 'Theme River Map',
|
||||||
|
sunburst: 'Vícevrstvý prstencový graf',
|
||||||
|
custom: 'Graficu persunalizatu',
|
||||||
|
chart: 'Graf'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
aria: {
|
||||||
|
general: {
|
||||||
|
withTitle: 'Toto je graf o "{title}"',
|
||||||
|
withoutTitle: 'Toto je graf'
|
||||||
|
},
|
||||||
|
series: {
|
||||||
|
single: {
|
||||||
|
prefix: '',
|
||||||
|
withName: '{seriesName} s typem {seriesType}.',
|
||||||
|
withoutName: ' s typem {seriesType}.'
|
||||||
|
},
|
||||||
|
multiple: {
|
||||||
|
prefix: '. Obsahuje {seriesCount} řad.',
|
||||||
|
withName: ' Řada {seriesId} je typu {seriesType} repreyentující {seriesName}.',
|
||||||
|
withoutName: ' Řada {seriesId} je typu {seriesType}.',
|
||||||
|
separator: {
|
||||||
|
middle: '',
|
||||||
|
end: ''
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data: {
|
||||||
|
allData: 'Všechna data jsou: ',
|
||||||
|
partialData: 'První {displayCnt} položky jsou: ',
|
||||||
|
withName: 'data pro {name} jsou {value}',
|
||||||
|
withoutName: '{value}',
|
||||||
|
separator: {
|
||||||
|
middle: ', ',
|
||||||
|
end: '. '
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
for (var key in localeObj) {
|
||||||
|
if (localeObj.hasOwnProperty(key)) {
|
||||||
|
exports[key] = localeObj[key];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
+171
@@ -0,0 +1,171 @@
|
|||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
* distributed with this work for additional information
|
||||||
|
* regarding copyright ownership. The ASF licenses this file
|
||||||
|
* to you under the Apache License, Version 2.0 (the
|
||||||
|
* "License"); you may not use this file except in compliance
|
||||||
|
* with the License. You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing,
|
||||||
|
* software distributed under the License is distributed on an
|
||||||
|
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||||
|
* KIND, either express or implied. See the License for the
|
||||||
|
* specific language governing permissions and limitations
|
||||||
|
* under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* AUTO-GENERATED FILE. DO NOT MODIFY.
|
||||||
|
*/
|
||||||
|
(function(root, factory) {
|
||||||
|
if (typeof define === 'function' && define.amd) {
|
||||||
|
// AMD. Register as an anonymous module.
|
||||||
|
define(['exports', 'echarts'], factory);
|
||||||
|
} else if (
|
||||||
|
typeof exports === 'object' &&
|
||||||
|
typeof exports.nodeName !== 'string'
|
||||||
|
) {
|
||||||
|
// CommonJS
|
||||||
|
factory(exports, require('echarts/lib/echarts'));
|
||||||
|
} else {
|
||||||
|
// Browser globals
|
||||||
|
factory({}, root.echarts);
|
||||||
|
}
|
||||||
|
})(this, function(exports, echarts) {
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Language: Czech.
|
||||||
|
*/
|
||||||
|
|
||||||
|
var localeObj = {
|
||||||
|
time: {
|
||||||
|
month: [
|
||||||
|
'Leden', 'Únor', 'Březen', 'Duben', 'Květen', 'Červen',
|
||||||
|
'Červenec', 'Srpen', 'Září', 'Říjen', 'Listopad', 'Prosinec'
|
||||||
|
],
|
||||||
|
monthAbbr: [
|
||||||
|
'Led', 'Úno', 'Bře', 'Dub', 'Kvě', 'Čvn',
|
||||||
|
'Čvc', 'Srp', 'Zář', 'Říj', 'Lis', 'Pro'
|
||||||
|
],
|
||||||
|
dayOfWeek: [
|
||||||
|
'Neděle', 'Pondělí', 'Úterý', 'Středa', 'Čtvrtek', 'Pátek', 'Sobota'
|
||||||
|
],
|
||||||
|
dayOfWeekAbbr: [
|
||||||
|
'Ne', 'Po', 'Út', 'St', 'Čt', 'Pá', 'So'
|
||||||
|
]
|
||||||
|
},
|
||||||
|
legend: {
|
||||||
|
selector: {
|
||||||
|
all: 'Vše',
|
||||||
|
inverse: 'Inv'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
toolbox: {
|
||||||
|
brush: {
|
||||||
|
title: {
|
||||||
|
rect: 'Obdélníkový výběr',
|
||||||
|
polygon: 'Lasso výběr',
|
||||||
|
lineX: 'Horizontální výběr',
|
||||||
|
lineY: 'Vertikální výběr',
|
||||||
|
keep: 'Ponechat výběr',
|
||||||
|
clear: 'Zrušit výběr'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
dataView: {
|
||||||
|
title: 'Data',
|
||||||
|
lang: ['Data', 'Zavřít', 'Obnovit']
|
||||||
|
},
|
||||||
|
dataZoom: {
|
||||||
|
title: {
|
||||||
|
zoom: 'Přiblížit',
|
||||||
|
back: 'Oddálit'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
magicType: {
|
||||||
|
title: {
|
||||||
|
line: 'Změnit na Spojnicový graf',
|
||||||
|
bar: 'Změnit na Sloupcový graf',
|
||||||
|
stack: 'Plošný',
|
||||||
|
tiled: 'Tile'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
restore: {
|
||||||
|
title: 'Obnovit'
|
||||||
|
},
|
||||||
|
saveAsImage: {
|
||||||
|
title: 'Uložit jako obrázek',
|
||||||
|
lang: ['Obrázek uložte pravým kliknutím']
|
||||||
|
}
|
||||||
|
},
|
||||||
|
series: {
|
||||||
|
typeNames: {
|
||||||
|
pie: 'Výsečový graf',
|
||||||
|
bar: 'Sloupcový graf',
|
||||||
|
line: 'Spojnicový graf',
|
||||||
|
scatter: 'XY bodový graf',
|
||||||
|
effectScatter: 'Effect XY bodový graf',
|
||||||
|
radar: 'Paprskový graf',
|
||||||
|
tree: 'Strom',
|
||||||
|
treemap: 'Stromová mapa',
|
||||||
|
boxplot: 'Krabicový graf',
|
||||||
|
candlestick: 'Burzovní graf',
|
||||||
|
k: 'K spojnicový graf',
|
||||||
|
heatmap: 'Teplotní mapa',
|
||||||
|
map: 'Mapa',
|
||||||
|
parallel: 'Rovnoběžné souřadnice',
|
||||||
|
lines: 'Spojnicový graf',
|
||||||
|
graph: 'Graf vztahů',
|
||||||
|
sankey: 'Sankeyův diagram',
|
||||||
|
funnel: 'Trychtýř (Funnel)',
|
||||||
|
gauge: 'Indikátor',
|
||||||
|
pictorialBar: 'Obrázkový sloupcový graf',
|
||||||
|
themeRiver: 'Theme River Map',
|
||||||
|
sunburst: 'Vícevrstvý prstencový graf',
|
||||||
|
custom: 'Graficu persunalizatu',
|
||||||
|
chart: 'Graf'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
aria: {
|
||||||
|
general: {
|
||||||
|
withTitle: 'Toto je graf o "{title}"',
|
||||||
|
withoutTitle: 'Toto je graf'
|
||||||
|
},
|
||||||
|
series: {
|
||||||
|
single: {
|
||||||
|
prefix: '',
|
||||||
|
withName: '{seriesName} s typem {seriesType}.',
|
||||||
|
withoutName: ' s typem {seriesType}.'
|
||||||
|
},
|
||||||
|
multiple: {
|
||||||
|
prefix: '. Obsahuje {seriesCount} řad.',
|
||||||
|
withName: ' Řada {seriesId} je typu {seriesType} repreyentující {seriesName}.',
|
||||||
|
withoutName: ' Řada {seriesId} je typu {seriesType}.',
|
||||||
|
separator: {
|
||||||
|
middle: '',
|
||||||
|
end: ''
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data: {
|
||||||
|
allData: 'Všechna data jsou: ',
|
||||||
|
partialData: 'První {displayCnt} položky jsou: ',
|
||||||
|
withName: 'data pro {name} jsou {value}',
|
||||||
|
withoutName: '{value}',
|
||||||
|
separator: {
|
||||||
|
middle: ', ',
|
||||||
|
end: '. '
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
echarts.registerLocale('CS', localeObj);
|
||||||
|
|
||||||
|
});
|
||||||
+175
@@ -0,0 +1,175 @@
|
|||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
* distributed with this work for additional information
|
||||||
|
* regarding copyright ownership. The ASF licenses this file
|
||||||
|
* to you under the Apache License, Version 2.0 (the
|
||||||
|
* "License"); you may not use this file except in compliance
|
||||||
|
* with the License. You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing,
|
||||||
|
* software distributed under the License is distributed on an
|
||||||
|
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||||
|
* KIND, either express or implied. See the License for the
|
||||||
|
* specific language governing permissions and limitations
|
||||||
|
* under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* AUTO-GENERATED FILE. DO NOT MODIFY.
|
||||||
|
*/
|
||||||
|
(function(root, factory) {
|
||||||
|
if (typeof define === 'function' && define.amd) {
|
||||||
|
// AMD. Register as an anonymous module.
|
||||||
|
define(['exports'], factory);
|
||||||
|
} else if (
|
||||||
|
typeof exports === 'object' &&
|
||||||
|
typeof exports.nodeName !== 'string'
|
||||||
|
) {
|
||||||
|
// CommonJS
|
||||||
|
factory(exports);
|
||||||
|
} else {
|
||||||
|
// Browser globals
|
||||||
|
factory({});
|
||||||
|
}
|
||||||
|
})(this, function(exports) {
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Language: German.
|
||||||
|
*/
|
||||||
|
|
||||||
|
var localeObj = {
|
||||||
|
time: {
|
||||||
|
month: [
|
||||||
|
'Januar', 'Februar', 'März', 'April', 'Mai', 'Juni',
|
||||||
|
'Juli', 'August', 'September', 'Oktober', 'November', 'Dezember'
|
||||||
|
],
|
||||||
|
monthAbbr: [
|
||||||
|
'Jan', 'Feb', 'Mrz', 'Apr', 'Mai', 'Jun',
|
||||||
|
'Jul', 'Aug', 'Sep', 'Okt', 'Nov', 'Dez'
|
||||||
|
],
|
||||||
|
dayOfWeek: [
|
||||||
|
'Sonntag', 'Montag', 'Dienstag', 'Mittwoch', 'Donnerstag', 'Freitag', 'Samstag'
|
||||||
|
],
|
||||||
|
dayOfWeekAbbr: [
|
||||||
|
'So', 'Mo', 'Di', 'Mi', 'Do', 'Fr', 'Sa'
|
||||||
|
]
|
||||||
|
},
|
||||||
|
legend: {
|
||||||
|
selector: {
|
||||||
|
all: 'Alle',
|
||||||
|
inverse: 'Invertiert'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
toolbox: {
|
||||||
|
brush: {
|
||||||
|
title: {
|
||||||
|
rect: 'Box Auswahl',
|
||||||
|
polygon: 'Lasso Auswahl',
|
||||||
|
lineX: 'Horizontale Auswahl',
|
||||||
|
lineY: 'Vertikale Auswahl',
|
||||||
|
keep: 'Bereich Auswahl',
|
||||||
|
clear: 'Auswahl zurücksetzen'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
dataView: {
|
||||||
|
title: 'Daten Ansicht',
|
||||||
|
lang: ['Daten Ansicht', 'Schließen', 'Aktualisieren']
|
||||||
|
},
|
||||||
|
dataZoom: {
|
||||||
|
title: {
|
||||||
|
zoom: 'Zoom',
|
||||||
|
back: 'Zoom zurücksetzen'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
magicType: {
|
||||||
|
title: {
|
||||||
|
line: 'Zu Liniendiagramm wechseln',
|
||||||
|
bar: 'Zu Balkendiagramm wechseln',
|
||||||
|
stack: 'Stapel',
|
||||||
|
tiled: 'Kachel'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
restore: {
|
||||||
|
title: 'Wiederherstellen'
|
||||||
|
},
|
||||||
|
saveAsImage: {
|
||||||
|
title: 'Als Bild speichern',
|
||||||
|
lang: ['Rechtsklick zum Speichern des Bildes']
|
||||||
|
}
|
||||||
|
},
|
||||||
|
series: {
|
||||||
|
typeNames: {
|
||||||
|
pie: 'Tortendiagramm',
|
||||||
|
bar: 'Balkendiagramm',
|
||||||
|
line: 'Liniendiagramm',
|
||||||
|
scatter: 'Streudiagramm',
|
||||||
|
effectScatter: 'Welligkeits-Streudiagramm',
|
||||||
|
radar: 'Radar-Karte',
|
||||||
|
tree: 'Baum',
|
||||||
|
treemap: 'Baumkarte',
|
||||||
|
boxplot: 'Boxplot',
|
||||||
|
candlestick: 'Kerzenständer',
|
||||||
|
k: 'K Liniendiagramm',
|
||||||
|
heatmap: 'Heatmap',
|
||||||
|
map: 'Karte',
|
||||||
|
parallel: 'Parallele Koordinatenkarte',
|
||||||
|
lines: 'Liniendiagramm',
|
||||||
|
graph: 'Beziehungsgrafik',
|
||||||
|
sankey: 'Sankey-Diagramm',
|
||||||
|
funnel: 'Trichterdiagramm',
|
||||||
|
gauge: 'Meßanzeige',
|
||||||
|
pictorialBar: 'Bildlicher Balken',
|
||||||
|
themeRiver: 'Thematische Flusskarte',
|
||||||
|
sunburst: 'Sonnenausbruch',
|
||||||
|
custom: 'Benutzerdefiniertes Diagramm',
|
||||||
|
chart: 'Diagramm'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
aria: {
|
||||||
|
general: {
|
||||||
|
withTitle: 'Dies ist ein Diagramm über "{title}"',
|
||||||
|
withoutTitle: 'Dies ist ein Diagramm'
|
||||||
|
},
|
||||||
|
series: {
|
||||||
|
single: {
|
||||||
|
prefix: '',
|
||||||
|
withName: ' mit Typ {seriesType} namens {seriesName}.',
|
||||||
|
withoutName: ' mit Typ {seriesType}.'
|
||||||
|
},
|
||||||
|
multiple: {
|
||||||
|
prefix: '. Es besteht aus {seriesCount} Serienzählung.',
|
||||||
|
withName: ' Die Serie {seriesId} ist ein {seriesType} welcher {seriesName} darstellt.',
|
||||||
|
withoutName: ' Die {seriesId}-Reihe ist ein {seriesType}.',
|
||||||
|
separator: {
|
||||||
|
middle: '',
|
||||||
|
end: ''
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data: {
|
||||||
|
allData: 'Die Daten sind wie folgt: ',
|
||||||
|
partialData: 'Die ersten {displayCnt} Elemente sind: ',
|
||||||
|
withName: 'die Daten für {name} sind {value}',
|
||||||
|
withoutName: '{value}',
|
||||||
|
separator: {
|
||||||
|
middle: ',',
|
||||||
|
end: '.'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
for (var key in localeObj) {
|
||||||
|
if (localeObj.hasOwnProperty(key)) {
|
||||||
|
exports[key] = localeObj[key];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
+171
@@ -0,0 +1,171 @@
|
|||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
* distributed with this work for additional information
|
||||||
|
* regarding copyright ownership. The ASF licenses this file
|
||||||
|
* to you under the Apache License, Version 2.0 (the
|
||||||
|
* "License"); you may not use this file except in compliance
|
||||||
|
* with the License. You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing,
|
||||||
|
* software distributed under the License is distributed on an
|
||||||
|
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||||
|
* KIND, either express or implied. See the License for the
|
||||||
|
* specific language governing permissions and limitations
|
||||||
|
* under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* AUTO-GENERATED FILE. DO NOT MODIFY.
|
||||||
|
*/
|
||||||
|
(function(root, factory) {
|
||||||
|
if (typeof define === 'function' && define.amd) {
|
||||||
|
// AMD. Register as an anonymous module.
|
||||||
|
define(['exports', 'echarts'], factory);
|
||||||
|
} else if (
|
||||||
|
typeof exports === 'object' &&
|
||||||
|
typeof exports.nodeName !== 'string'
|
||||||
|
) {
|
||||||
|
// CommonJS
|
||||||
|
factory(exports, require('echarts/lib/echarts'));
|
||||||
|
} else {
|
||||||
|
// Browser globals
|
||||||
|
factory({}, root.echarts);
|
||||||
|
}
|
||||||
|
})(this, function(exports, echarts) {
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Language: German.
|
||||||
|
*/
|
||||||
|
|
||||||
|
var localeObj = {
|
||||||
|
time: {
|
||||||
|
month: [
|
||||||
|
'Januar', 'Februar', 'März', 'April', 'Mai', 'Juni',
|
||||||
|
'Juli', 'August', 'September', 'Oktober', 'November', 'Dezember'
|
||||||
|
],
|
||||||
|
monthAbbr: [
|
||||||
|
'Jan', 'Feb', 'Mrz', 'Apr', 'Mai', 'Jun',
|
||||||
|
'Jul', 'Aug', 'Sep', 'Okt', 'Nov', 'Dez'
|
||||||
|
],
|
||||||
|
dayOfWeek: [
|
||||||
|
'Sonntag', 'Montag', 'Dienstag', 'Mittwoch', 'Donnerstag', 'Freitag', 'Samstag'
|
||||||
|
],
|
||||||
|
dayOfWeekAbbr: [
|
||||||
|
'So', 'Mo', 'Di', 'Mi', 'Do', 'Fr', 'Sa'
|
||||||
|
]
|
||||||
|
},
|
||||||
|
legend: {
|
||||||
|
selector: {
|
||||||
|
all: 'Alle',
|
||||||
|
inverse: 'Invertiert'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
toolbox: {
|
||||||
|
brush: {
|
||||||
|
title: {
|
||||||
|
rect: 'Box Auswahl',
|
||||||
|
polygon: 'Lasso Auswahl',
|
||||||
|
lineX: 'Horizontale Auswahl',
|
||||||
|
lineY: 'Vertikale Auswahl',
|
||||||
|
keep: 'Bereich Auswahl',
|
||||||
|
clear: 'Auswahl zurücksetzen'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
dataView: {
|
||||||
|
title: 'Daten Ansicht',
|
||||||
|
lang: ['Daten Ansicht', 'Schließen', 'Aktualisieren']
|
||||||
|
},
|
||||||
|
dataZoom: {
|
||||||
|
title: {
|
||||||
|
zoom: 'Zoom',
|
||||||
|
back: 'Zoom zurücksetzen'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
magicType: {
|
||||||
|
title: {
|
||||||
|
line: 'Zu Liniendiagramm wechseln',
|
||||||
|
bar: 'Zu Balkendiagramm wechseln',
|
||||||
|
stack: 'Stapel',
|
||||||
|
tiled: 'Kachel'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
restore: {
|
||||||
|
title: 'Wiederherstellen'
|
||||||
|
},
|
||||||
|
saveAsImage: {
|
||||||
|
title: 'Als Bild speichern',
|
||||||
|
lang: ['Rechtsklick zum Speichern des Bildes']
|
||||||
|
}
|
||||||
|
},
|
||||||
|
series: {
|
||||||
|
typeNames: {
|
||||||
|
pie: 'Tortendiagramm',
|
||||||
|
bar: 'Balkendiagramm',
|
||||||
|
line: 'Liniendiagramm',
|
||||||
|
scatter: 'Streudiagramm',
|
||||||
|
effectScatter: 'Welligkeits-Streudiagramm',
|
||||||
|
radar: 'Radar-Karte',
|
||||||
|
tree: 'Baum',
|
||||||
|
treemap: 'Baumkarte',
|
||||||
|
boxplot: 'Boxplot',
|
||||||
|
candlestick: 'Kerzenständer',
|
||||||
|
k: 'K Liniendiagramm',
|
||||||
|
heatmap: 'Heatmap',
|
||||||
|
map: 'Karte',
|
||||||
|
parallel: 'Parallele Koordinatenkarte',
|
||||||
|
lines: 'Liniendiagramm',
|
||||||
|
graph: 'Beziehungsgrafik',
|
||||||
|
sankey: 'Sankey-Diagramm',
|
||||||
|
funnel: 'Trichterdiagramm',
|
||||||
|
gauge: 'Meßanzeige',
|
||||||
|
pictorialBar: 'Bildlicher Balken',
|
||||||
|
themeRiver: 'Thematische Flusskarte',
|
||||||
|
sunburst: 'Sonnenausbruch',
|
||||||
|
custom: 'Benutzerdefiniertes Diagramm',
|
||||||
|
chart: 'Diagramm'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
aria: {
|
||||||
|
general: {
|
||||||
|
withTitle: 'Dies ist ein Diagramm über "{title}"',
|
||||||
|
withoutTitle: 'Dies ist ein Diagramm'
|
||||||
|
},
|
||||||
|
series: {
|
||||||
|
single: {
|
||||||
|
prefix: '',
|
||||||
|
withName: ' mit Typ {seriesType} namens {seriesName}.',
|
||||||
|
withoutName: ' mit Typ {seriesType}.'
|
||||||
|
},
|
||||||
|
multiple: {
|
||||||
|
prefix: '. Es besteht aus {seriesCount} Serienzählung.',
|
||||||
|
withName: ' Die Serie {seriesId} ist ein {seriesType} welcher {seriesName} darstellt.',
|
||||||
|
withoutName: ' Die {seriesId}-Reihe ist ein {seriesType}.',
|
||||||
|
separator: {
|
||||||
|
middle: '',
|
||||||
|
end: ''
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data: {
|
||||||
|
allData: 'Die Daten sind wie folgt: ',
|
||||||
|
partialData: 'Die ersten {displayCnt} Elemente sind: ',
|
||||||
|
withName: 'die Daten für {name} sind {value}',
|
||||||
|
withoutName: '{value}',
|
||||||
|
separator: {
|
||||||
|
middle: ',',
|
||||||
|
end: '.'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
echarts.registerLocale('DE', localeObj);
|
||||||
|
|
||||||
|
});
|
||||||
+175
@@ -0,0 +1,175 @@
|
|||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
* distributed with this work for additional information
|
||||||
|
* regarding copyright ownership. The ASF licenses this file
|
||||||
|
* to you under the Apache License, Version 2.0 (the
|
||||||
|
* "License"); you may not use this file except in compliance
|
||||||
|
* with the License. You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing,
|
||||||
|
* software distributed under the License is distributed on an
|
||||||
|
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||||
|
* KIND, either express or implied. See the License for the
|
||||||
|
* specific language governing permissions and limitations
|
||||||
|
* under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* AUTO-GENERATED FILE. DO NOT MODIFY.
|
||||||
|
*/
|
||||||
|
(function(root, factory) {
|
||||||
|
if (typeof define === 'function' && define.amd) {
|
||||||
|
// AMD. Register as an anonymous module.
|
||||||
|
define(['exports'], factory);
|
||||||
|
} else if (
|
||||||
|
typeof exports === 'object' &&
|
||||||
|
typeof exports.nodeName !== 'string'
|
||||||
|
) {
|
||||||
|
// CommonJS
|
||||||
|
factory(exports);
|
||||||
|
} else {
|
||||||
|
// Browser globals
|
||||||
|
factory({});
|
||||||
|
}
|
||||||
|
})(this, function(exports) {
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Language: Greek.
|
||||||
|
*/
|
||||||
|
|
||||||
|
var localeObj = {
|
||||||
|
time: {
|
||||||
|
month: [
|
||||||
|
'Ιανουάριος', 'Φεβρουάριος', 'Μάρτιος', 'Απρίλιος', 'Μάιος', 'Ιούνιος',
|
||||||
|
'Ιούλιος', 'Αύγουστος', 'Σεπτέμβριος', 'Οκτώβριος', 'Νοέμβριος', 'Δεκέμβριος'
|
||||||
|
],
|
||||||
|
monthAbbr: [
|
||||||
|
'Ιαν', 'Φεβ', 'Μαρ', 'Απρ', 'Μαϊ', 'Ιουν',
|
||||||
|
'Ιουλ', 'Αυγ', 'Σεπ', 'Οκτ', 'Νοε', 'Δεκ'
|
||||||
|
],
|
||||||
|
dayOfWeek: [
|
||||||
|
'Κυριακή', 'Δευτέρα', 'Τρίτη', 'Τετάρτη', 'Πέμπτη', 'Παρασκευή', 'Σάββατο'
|
||||||
|
],
|
||||||
|
dayOfWeekAbbr: [
|
||||||
|
'Κυρ', 'Δευ', 'Τρι', 'Τετ', 'Πεμ', 'Παρ', 'Σαβ'
|
||||||
|
]
|
||||||
|
},
|
||||||
|
legend: {
|
||||||
|
selector: {
|
||||||
|
all: 'Όλα',
|
||||||
|
inverse: 'Αντιστροφή'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
toolbox: {
|
||||||
|
brush: {
|
||||||
|
title: {
|
||||||
|
rect: 'Επιλογή με πλαίσιο',
|
||||||
|
polygon: 'Επιλογή με λάσο',
|
||||||
|
lineX: 'Οριζόντια επιλογή',
|
||||||
|
lineY: 'Κατακόρυφη επιλογή',
|
||||||
|
keep: 'Διατήρηση επιλογών',
|
||||||
|
clear: 'Καθαρισμός επιλογών'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
dataView: {
|
||||||
|
title: 'Προβολή δεδομένων',
|
||||||
|
lang: ['Προβολή δεδομένων', 'Κλείσιμο', 'Ανανένωση']
|
||||||
|
},
|
||||||
|
dataZoom: {
|
||||||
|
title: {
|
||||||
|
zoom: 'Μεγέθυνση',
|
||||||
|
back: 'Επαναφορά μεγέθυνσης'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
magicType: {
|
||||||
|
title: {
|
||||||
|
line: 'Αλλαγή σε γραμμικό διάγραμμα',
|
||||||
|
bar: 'Αλλαγή σε ραβδογράφημα',
|
||||||
|
stack: 'Στοίβα',
|
||||||
|
tiled: 'Πλακίδια'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
restore: {
|
||||||
|
title: 'Επαναφορά'
|
||||||
|
},
|
||||||
|
saveAsImage: {
|
||||||
|
title: 'Αποθήκευση ως εικόνα',
|
||||||
|
lang: ['Δεξί κλικ για αποθήκευση εικόνας']
|
||||||
|
}
|
||||||
|
},
|
||||||
|
series: {
|
||||||
|
typeNames: {
|
||||||
|
pie: 'Γράφημα πίτας',
|
||||||
|
bar: 'Ραβδογράφημα',
|
||||||
|
line: 'Γραμμικό διάγραμμα',
|
||||||
|
scatter: 'Διάγραμμα διασποράς',
|
||||||
|
effectScatter: 'Διάγραμμα διασποράς με κυματισμό',
|
||||||
|
radar: 'Διάγραμμα ραντάρ',
|
||||||
|
tree: 'Δενδρόγραμμα',
|
||||||
|
treemap: 'Διάγραμμα διαμερισματοποίησης',
|
||||||
|
boxplot: 'Γράφημα πλαισίου-απολήξεων',
|
||||||
|
candlestick: 'Διάγραμμα κηροπηγίων',
|
||||||
|
k: 'Διάγραμμα Κ',
|
||||||
|
heatmap: 'Θερμικός χάρτης',
|
||||||
|
map: 'Χάρτης',
|
||||||
|
parallel: 'Χάρτης παράλληλων συντεταγμένων',
|
||||||
|
lines: 'Γράφημα γραμμών',
|
||||||
|
graph: 'Γράφος σχέσεων',
|
||||||
|
sankey: 'Διάγραμμα Sankey',
|
||||||
|
funnel: 'Διάγραμμα χωνιού',
|
||||||
|
gauge: 'Διάγραμμα μετρητή',
|
||||||
|
pictorialBar: 'Εικονογραφικό ραβδογράφημα',
|
||||||
|
themeRiver: 'Γράφημα Ροής Κατηγοριών',
|
||||||
|
sunburst: 'Γράφημα Ιεραρχικών Δακτυλίων',
|
||||||
|
custom: 'Προσαρμοσμένο διάγραμμα',
|
||||||
|
chart: 'Διάγραμμα'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
aria: {
|
||||||
|
general: {
|
||||||
|
withTitle: 'Αυτό είναι ένα διάγραμμα με τίτλο "{title}"',
|
||||||
|
withoutTitle: 'Αυτό είναι ένα διάγραμμα'
|
||||||
|
},
|
||||||
|
series: {
|
||||||
|
single: {
|
||||||
|
prefix: '',
|
||||||
|
withName: ' με τύπο {seriesType} και όνομα {seriesName}.',
|
||||||
|
withoutName: ' με τύπο {seriesType}.'
|
||||||
|
},
|
||||||
|
multiple: {
|
||||||
|
prefix: '. Αποτελείται από {seriesCount} σειρές δεδομένων.',
|
||||||
|
withName: ' Η σειρά {seriesId} είναι {seriesType} με όνομα {seriesName}.',
|
||||||
|
withoutName: ' Η σειρά {seriesId} είναι {seriesType}.',
|
||||||
|
separator: {
|
||||||
|
middle: '',
|
||||||
|
end: ''
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data: {
|
||||||
|
allData: 'Τα δεδομένα είναι τα εξής:',
|
||||||
|
partialData: 'Τα πρώτα {displayCnt} στοιχεία είναι: ',
|
||||||
|
withName: 'τα δεδομένα για {name} είναι {value}',
|
||||||
|
withoutName: '{value}',
|
||||||
|
separator: {
|
||||||
|
middle: ', ',
|
||||||
|
end: '. '
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
for (var key in localeObj) {
|
||||||
|
if (localeObj.hasOwnProperty(key)) {
|
||||||
|
exports[key] = localeObj[key];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
+171
@@ -0,0 +1,171 @@
|
|||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
* distributed with this work for additional information
|
||||||
|
* regarding copyright ownership. The ASF licenses this file
|
||||||
|
* to you under the Apache License, Version 2.0 (the
|
||||||
|
* "License"); you may not use this file except in compliance
|
||||||
|
* with the License. You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing,
|
||||||
|
* software distributed under the License is distributed on an
|
||||||
|
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||||
|
* KIND, either express or implied. See the License for the
|
||||||
|
* specific language governing permissions and limitations
|
||||||
|
* under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* AUTO-GENERATED FILE. DO NOT MODIFY.
|
||||||
|
*/
|
||||||
|
(function(root, factory) {
|
||||||
|
if (typeof define === 'function' && define.amd) {
|
||||||
|
// AMD. Register as an anonymous module.
|
||||||
|
define(['exports', 'echarts'], factory);
|
||||||
|
} else if (
|
||||||
|
typeof exports === 'object' &&
|
||||||
|
typeof exports.nodeName !== 'string'
|
||||||
|
) {
|
||||||
|
// CommonJS
|
||||||
|
factory(exports, require('echarts/lib/echarts'));
|
||||||
|
} else {
|
||||||
|
// Browser globals
|
||||||
|
factory({}, root.echarts);
|
||||||
|
}
|
||||||
|
})(this, function(exports, echarts) {
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Language: Greek.
|
||||||
|
*/
|
||||||
|
|
||||||
|
var localeObj = {
|
||||||
|
time: {
|
||||||
|
month: [
|
||||||
|
'Ιανουάριος', 'Φεβρουάριος', 'Μάρτιος', 'Απρίλιος', 'Μάιος', 'Ιούνιος',
|
||||||
|
'Ιούλιος', 'Αύγουστος', 'Σεπτέμβριος', 'Οκτώβριος', 'Νοέμβριος', 'Δεκέμβριος'
|
||||||
|
],
|
||||||
|
monthAbbr: [
|
||||||
|
'Ιαν', 'Φεβ', 'Μαρ', 'Απρ', 'Μαϊ', 'Ιουν',
|
||||||
|
'Ιουλ', 'Αυγ', 'Σεπ', 'Οκτ', 'Νοε', 'Δεκ'
|
||||||
|
],
|
||||||
|
dayOfWeek: [
|
||||||
|
'Κυριακή', 'Δευτέρα', 'Τρίτη', 'Τετάρτη', 'Πέμπτη', 'Παρασκευή', 'Σάββατο'
|
||||||
|
],
|
||||||
|
dayOfWeekAbbr: [
|
||||||
|
'Κυρ', 'Δευ', 'Τρι', 'Τετ', 'Πεμ', 'Παρ', 'Σαβ'
|
||||||
|
]
|
||||||
|
},
|
||||||
|
legend: {
|
||||||
|
selector: {
|
||||||
|
all: 'Όλα',
|
||||||
|
inverse: 'Αντιστροφή'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
toolbox: {
|
||||||
|
brush: {
|
||||||
|
title: {
|
||||||
|
rect: 'Επιλογή με πλαίσιο',
|
||||||
|
polygon: 'Επιλογή με λάσο',
|
||||||
|
lineX: 'Οριζόντια επιλογή',
|
||||||
|
lineY: 'Κατακόρυφη επιλογή',
|
||||||
|
keep: 'Διατήρηση επιλογών',
|
||||||
|
clear: 'Καθαρισμός επιλογών'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
dataView: {
|
||||||
|
title: 'Προβολή δεδομένων',
|
||||||
|
lang: ['Προβολή δεδομένων', 'Κλείσιμο', 'Ανανένωση']
|
||||||
|
},
|
||||||
|
dataZoom: {
|
||||||
|
title: {
|
||||||
|
zoom: 'Μεγέθυνση',
|
||||||
|
back: 'Επαναφορά μεγέθυνσης'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
magicType: {
|
||||||
|
title: {
|
||||||
|
line: 'Αλλαγή σε γραμμικό διάγραμμα',
|
||||||
|
bar: 'Αλλαγή σε ραβδογράφημα',
|
||||||
|
stack: 'Στοίβα',
|
||||||
|
tiled: 'Πλακίδια'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
restore: {
|
||||||
|
title: 'Επαναφορά'
|
||||||
|
},
|
||||||
|
saveAsImage: {
|
||||||
|
title: 'Αποθήκευση ως εικόνα',
|
||||||
|
lang: ['Δεξί κλικ για αποθήκευση εικόνας']
|
||||||
|
}
|
||||||
|
},
|
||||||
|
series: {
|
||||||
|
typeNames: {
|
||||||
|
pie: 'Γράφημα πίτας',
|
||||||
|
bar: 'Ραβδογράφημα',
|
||||||
|
line: 'Γραμμικό διάγραμμα',
|
||||||
|
scatter: 'Διάγραμμα διασποράς',
|
||||||
|
effectScatter: 'Διάγραμμα διασποράς με κυματισμό',
|
||||||
|
radar: 'Διάγραμμα ραντάρ',
|
||||||
|
tree: 'Δενδρόγραμμα',
|
||||||
|
treemap: 'Διάγραμμα διαμερισματοποίησης',
|
||||||
|
boxplot: 'Γράφημα πλαισίου-απολήξεων',
|
||||||
|
candlestick: 'Διάγραμμα κηροπηγίων',
|
||||||
|
k: 'Διάγραμμα Κ',
|
||||||
|
heatmap: 'Θερμικός χάρτης',
|
||||||
|
map: 'Χάρτης',
|
||||||
|
parallel: 'Χάρτης παράλληλων συντεταγμένων',
|
||||||
|
lines: 'Γράφημα γραμμών',
|
||||||
|
graph: 'Γράφος σχέσεων',
|
||||||
|
sankey: 'Διάγραμμα Sankey',
|
||||||
|
funnel: 'Διάγραμμα χωνιού',
|
||||||
|
gauge: 'Διάγραμμα μετρητή',
|
||||||
|
pictorialBar: 'Εικονογραφικό ραβδογράφημα',
|
||||||
|
themeRiver: 'Γράφημα Ροής Κατηγοριών',
|
||||||
|
sunburst: 'Γράφημα Ιεραρχικών Δακτυλίων',
|
||||||
|
custom: 'Προσαρμοσμένο διάγραμμα',
|
||||||
|
chart: 'Διάγραμμα'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
aria: {
|
||||||
|
general: {
|
||||||
|
withTitle: 'Αυτό είναι ένα διάγραμμα με τίτλο "{title}"',
|
||||||
|
withoutTitle: 'Αυτό είναι ένα διάγραμμα'
|
||||||
|
},
|
||||||
|
series: {
|
||||||
|
single: {
|
||||||
|
prefix: '',
|
||||||
|
withName: ' με τύπο {seriesType} και όνομα {seriesName}.',
|
||||||
|
withoutName: ' με τύπο {seriesType}.'
|
||||||
|
},
|
||||||
|
multiple: {
|
||||||
|
prefix: '. Αποτελείται από {seriesCount} σειρές δεδομένων.',
|
||||||
|
withName: ' Η σειρά {seriesId} είναι {seriesType} με όνομα {seriesName}.',
|
||||||
|
withoutName: ' Η σειρά {seriesId} είναι {seriesType}.',
|
||||||
|
separator: {
|
||||||
|
middle: '',
|
||||||
|
end: ''
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data: {
|
||||||
|
allData: 'Τα δεδομένα είναι τα εξής:',
|
||||||
|
partialData: 'Τα πρώτα {displayCnt} στοιχεία είναι: ',
|
||||||
|
withName: 'τα δεδομένα για {name} είναι {value}',
|
||||||
|
withoutName: '{value}',
|
||||||
|
separator: {
|
||||||
|
middle: ', ',
|
||||||
|
end: '. '
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
echarts.registerLocale('EL', localeObj);
|
||||||
|
|
||||||
|
});
|
||||||
+175
@@ -0,0 +1,175 @@
|
|||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
* distributed with this work for additional information
|
||||||
|
* regarding copyright ownership. The ASF licenses this file
|
||||||
|
* to you under the Apache License, Version 2.0 (the
|
||||||
|
* "License"); you may not use this file except in compliance
|
||||||
|
* with the License. You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing,
|
||||||
|
* software distributed under the License is distributed on an
|
||||||
|
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||||
|
* KIND, either express or implied. See the License for the
|
||||||
|
* specific language governing permissions and limitations
|
||||||
|
* under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* AUTO-GENERATED FILE. DO NOT MODIFY.
|
||||||
|
*/
|
||||||
|
(function(root, factory) {
|
||||||
|
if (typeof define === 'function' && define.amd) {
|
||||||
|
// AMD. Register as an anonymous module.
|
||||||
|
define(['exports'], factory);
|
||||||
|
} else if (
|
||||||
|
typeof exports === 'object' &&
|
||||||
|
typeof exports.nodeName !== 'string'
|
||||||
|
) {
|
||||||
|
// CommonJS
|
||||||
|
factory(exports);
|
||||||
|
} else {
|
||||||
|
// Browser globals
|
||||||
|
factory({});
|
||||||
|
}
|
||||||
|
})(this, function(exports) {
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Language: English.
|
||||||
|
*/
|
||||||
|
|
||||||
|
var localeObj = {
|
||||||
|
time: {
|
||||||
|
month: [
|
||||||
|
'January', 'February', 'March', 'April', 'May', 'June',
|
||||||
|
'July', 'August', 'September', 'October', 'November', 'December'
|
||||||
|
],
|
||||||
|
monthAbbr: [
|
||||||
|
'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',
|
||||||
|
'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'
|
||||||
|
],
|
||||||
|
dayOfWeek: [
|
||||||
|
'Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'
|
||||||
|
],
|
||||||
|
dayOfWeekAbbr: [
|
||||||
|
'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'
|
||||||
|
]
|
||||||
|
},
|
||||||
|
legend: {
|
||||||
|
selector: {
|
||||||
|
all: 'All',
|
||||||
|
inverse: 'Inv'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
toolbox: {
|
||||||
|
brush: {
|
||||||
|
title: {
|
||||||
|
rect: 'Box Select',
|
||||||
|
polygon: 'Lasso Select',
|
||||||
|
lineX: 'Horizontally Select',
|
||||||
|
lineY: 'Vertically Select',
|
||||||
|
keep: 'Keep Selections',
|
||||||
|
clear: 'Clear Selections'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
dataView: {
|
||||||
|
title: 'Data View',
|
||||||
|
lang: ['Data View', 'Close', 'Refresh']
|
||||||
|
},
|
||||||
|
dataZoom: {
|
||||||
|
title: {
|
||||||
|
zoom: 'Zoom',
|
||||||
|
back: 'Zoom Reset'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
magicType: {
|
||||||
|
title: {
|
||||||
|
line: 'Switch to Line Chart',
|
||||||
|
bar: 'Switch to Bar Chart',
|
||||||
|
stack: 'Stack',
|
||||||
|
tiled: 'Tile'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
restore: {
|
||||||
|
title: 'Restore'
|
||||||
|
},
|
||||||
|
saveAsImage: {
|
||||||
|
title: 'Save as Image',
|
||||||
|
lang: ['Right Click to Save Image']
|
||||||
|
}
|
||||||
|
},
|
||||||
|
series: {
|
||||||
|
typeNames: {
|
||||||
|
pie: 'Pie chart',
|
||||||
|
bar: 'Bar chart',
|
||||||
|
line: 'Line chart',
|
||||||
|
scatter: 'Scatter plot',
|
||||||
|
effectScatter: 'Ripple scatter plot',
|
||||||
|
radar: 'Radar chart',
|
||||||
|
tree: 'Tree',
|
||||||
|
treemap: 'Treemap',
|
||||||
|
boxplot: 'Boxplot',
|
||||||
|
candlestick: 'Candlestick',
|
||||||
|
k: 'K line chart',
|
||||||
|
heatmap: 'Heat map',
|
||||||
|
map: 'Map',
|
||||||
|
parallel: 'Parallel coordinate map',
|
||||||
|
lines: 'Line graph',
|
||||||
|
graph: 'Relationship graph',
|
||||||
|
sankey: 'Sankey diagram',
|
||||||
|
funnel: 'Funnel chart',
|
||||||
|
gauge: 'Gauge',
|
||||||
|
pictorialBar: 'Pictorial bar',
|
||||||
|
themeRiver: 'Theme River Map',
|
||||||
|
sunburst: 'Sunburst',
|
||||||
|
custom: 'Custom chart',
|
||||||
|
chart: 'Chart'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
aria: {
|
||||||
|
general: {
|
||||||
|
withTitle: 'This is a chart about "{title}"',
|
||||||
|
withoutTitle: 'This is a chart'
|
||||||
|
},
|
||||||
|
series: {
|
||||||
|
single: {
|
||||||
|
prefix: '',
|
||||||
|
withName: ' with type {seriesType} named {seriesName}.',
|
||||||
|
withoutName: ' with type {seriesType}.'
|
||||||
|
},
|
||||||
|
multiple: {
|
||||||
|
prefix: '. It consists of {seriesCount} series count.',
|
||||||
|
withName: ' The {seriesId} series is a {seriesType} representing {seriesName}.',
|
||||||
|
withoutName: ' The {seriesId} series is a {seriesType}.',
|
||||||
|
separator: {
|
||||||
|
middle: '',
|
||||||
|
end: ''
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data: {
|
||||||
|
allData: 'The data is as follows: ',
|
||||||
|
partialData: 'The first {displayCnt} items are: ',
|
||||||
|
withName: 'the data for {name} is {value}',
|
||||||
|
withoutName: '{value}',
|
||||||
|
separator: {
|
||||||
|
middle: ', ',
|
||||||
|
end: '. '
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
for (var key in localeObj) {
|
||||||
|
if (localeObj.hasOwnProperty(key)) {
|
||||||
|
exports[key] = localeObj[key];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
+171
@@ -0,0 +1,171 @@
|
|||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
* distributed with this work for additional information
|
||||||
|
* regarding copyright ownership. The ASF licenses this file
|
||||||
|
* to you under the Apache License, Version 2.0 (the
|
||||||
|
* "License"); you may not use this file except in compliance
|
||||||
|
* with the License. You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing,
|
||||||
|
* software distributed under the License is distributed on an
|
||||||
|
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||||
|
* KIND, either express or implied. See the License for the
|
||||||
|
* specific language governing permissions and limitations
|
||||||
|
* under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* AUTO-GENERATED FILE. DO NOT MODIFY.
|
||||||
|
*/
|
||||||
|
(function(root, factory) {
|
||||||
|
if (typeof define === 'function' && define.amd) {
|
||||||
|
// AMD. Register as an anonymous module.
|
||||||
|
define(['exports', 'echarts'], factory);
|
||||||
|
} else if (
|
||||||
|
typeof exports === 'object' &&
|
||||||
|
typeof exports.nodeName !== 'string'
|
||||||
|
) {
|
||||||
|
// CommonJS
|
||||||
|
factory(exports, require('echarts/lib/echarts'));
|
||||||
|
} else {
|
||||||
|
// Browser globals
|
||||||
|
factory({}, root.echarts);
|
||||||
|
}
|
||||||
|
})(this, function(exports, echarts) {
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Language: English.
|
||||||
|
*/
|
||||||
|
|
||||||
|
var localeObj = {
|
||||||
|
time: {
|
||||||
|
month: [
|
||||||
|
'January', 'February', 'March', 'April', 'May', 'June',
|
||||||
|
'July', 'August', 'September', 'October', 'November', 'December'
|
||||||
|
],
|
||||||
|
monthAbbr: [
|
||||||
|
'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',
|
||||||
|
'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'
|
||||||
|
],
|
||||||
|
dayOfWeek: [
|
||||||
|
'Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'
|
||||||
|
],
|
||||||
|
dayOfWeekAbbr: [
|
||||||
|
'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'
|
||||||
|
]
|
||||||
|
},
|
||||||
|
legend: {
|
||||||
|
selector: {
|
||||||
|
all: 'All',
|
||||||
|
inverse: 'Inv'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
toolbox: {
|
||||||
|
brush: {
|
||||||
|
title: {
|
||||||
|
rect: 'Box Select',
|
||||||
|
polygon: 'Lasso Select',
|
||||||
|
lineX: 'Horizontally Select',
|
||||||
|
lineY: 'Vertically Select',
|
||||||
|
keep: 'Keep Selections',
|
||||||
|
clear: 'Clear Selections'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
dataView: {
|
||||||
|
title: 'Data View',
|
||||||
|
lang: ['Data View', 'Close', 'Refresh']
|
||||||
|
},
|
||||||
|
dataZoom: {
|
||||||
|
title: {
|
||||||
|
zoom: 'Zoom',
|
||||||
|
back: 'Zoom Reset'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
magicType: {
|
||||||
|
title: {
|
||||||
|
line: 'Switch to Line Chart',
|
||||||
|
bar: 'Switch to Bar Chart',
|
||||||
|
stack: 'Stack',
|
||||||
|
tiled: 'Tile'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
restore: {
|
||||||
|
title: 'Restore'
|
||||||
|
},
|
||||||
|
saveAsImage: {
|
||||||
|
title: 'Save as Image',
|
||||||
|
lang: ['Right Click to Save Image']
|
||||||
|
}
|
||||||
|
},
|
||||||
|
series: {
|
||||||
|
typeNames: {
|
||||||
|
pie: 'Pie chart',
|
||||||
|
bar: 'Bar chart',
|
||||||
|
line: 'Line chart',
|
||||||
|
scatter: 'Scatter plot',
|
||||||
|
effectScatter: 'Ripple scatter plot',
|
||||||
|
radar: 'Radar chart',
|
||||||
|
tree: 'Tree',
|
||||||
|
treemap: 'Treemap',
|
||||||
|
boxplot: 'Boxplot',
|
||||||
|
candlestick: 'Candlestick',
|
||||||
|
k: 'K line chart',
|
||||||
|
heatmap: 'Heat map',
|
||||||
|
map: 'Map',
|
||||||
|
parallel: 'Parallel coordinate map',
|
||||||
|
lines: 'Line graph',
|
||||||
|
graph: 'Relationship graph',
|
||||||
|
sankey: 'Sankey diagram',
|
||||||
|
funnel: 'Funnel chart',
|
||||||
|
gauge: 'Gauge',
|
||||||
|
pictorialBar: 'Pictorial bar',
|
||||||
|
themeRiver: 'Theme River Map',
|
||||||
|
sunburst: 'Sunburst',
|
||||||
|
custom: 'Custom chart',
|
||||||
|
chart: 'Chart'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
aria: {
|
||||||
|
general: {
|
||||||
|
withTitle: 'This is a chart about "{title}"',
|
||||||
|
withoutTitle: 'This is a chart'
|
||||||
|
},
|
||||||
|
series: {
|
||||||
|
single: {
|
||||||
|
prefix: '',
|
||||||
|
withName: ' with type {seriesType} named {seriesName}.',
|
||||||
|
withoutName: ' with type {seriesType}.'
|
||||||
|
},
|
||||||
|
multiple: {
|
||||||
|
prefix: '. It consists of {seriesCount} series count.',
|
||||||
|
withName: ' The {seriesId} series is a {seriesType} representing {seriesName}.',
|
||||||
|
withoutName: ' The {seriesId} series is a {seriesType}.',
|
||||||
|
separator: {
|
||||||
|
middle: '',
|
||||||
|
end: ''
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data: {
|
||||||
|
allData: 'The data is as follows: ',
|
||||||
|
partialData: 'The first {displayCnt} items are: ',
|
||||||
|
withName: 'the data for {name} is {value}',
|
||||||
|
withoutName: '{value}',
|
||||||
|
separator: {
|
||||||
|
middle: ', ',
|
||||||
|
end: '. '
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
echarts.registerLocale('EN', localeObj);
|
||||||
|
|
||||||
|
});
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user