Socket
Socket
Sign inDemoInstall

windy-plugin-sun-position

Package Overview
Dependencies
339
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.3.5 to 0.3.6

.eslintrc.cjs

356

compiler.js

@@ -7,110 +7,165 @@ #!/usr/bin/env node --no-warnings

*/
const prog = require('commander')
, { join } = require('path')
, c = require('consola')
, fs = require('fs-extra')
, { yellow, gray } = require('colorette')
, riot = require('riot-compiler')
, assert = require('assert')
, express = require('express')
, app = express()
, less = require('less')
, chokidar = require('chokidar')
, decache = require('decache')
, https = require('https')
, babel = require("@babel/core");
import fs from 'node:fs';
import path from 'node:path';
import { fileURLToPath } from 'node:url';
import assert from 'node:assert';
import https from 'node:https';
const utils = require('./dev/utils.js')
import { program } from 'commander';
import prompts from 'prompts';
import ucfirst from 'ucfirst';
import c from 'consola';
import { yellow, gray } from 'colorette';
import express from 'express';
import chokidar from 'chokidar';
import decache from 'decache';
const port = 9999
import { builder } from './dev/rollup.js';
const { version
, name
, author
, repository
, description } = require('./package.json')
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
prog
.option('-b, --build', 'Build the plugin in required directory (default src)')
.option('-w, --watch', 'Build plugin and watch file changes in required directory')
.option('-s, --serve', `Serve dist directory on port ${ port }`)
.option('-p, --prompt', 'Show command line promt with all the examples')
.option('-t, --transpile', 'Transpile your code with Babel')
.parse(process.argv);
const app = express();
const port = 9999;
const { version, name, author, repository, description } = JSON.parse(
fs.readFileSync(path.join(__dirname, 'package.json')),
);
const prog = program
.option('-b, --build', 'Build the plugin in required directory (default src)')
.option('-w, --watch', 'Build plugin and watch file changes in required directory')
.option('-s, --serve', `Serve dist directory on port ${port}`)
.option('-p, --prompt', 'Show command line promt with all the examples')
.option('-t, --transpile', 'Transpile your code with Babel')
.parse(process.argv)
.opts();
console.log(prog);
if (!process.argv.slice(2).length) {
prog.outputHelp()
process.exit()
program.outputHelp();
process.exit();
}
let config
, srcDir = 'src'
let config,
srcDir = 'src';
// Main
;(async () => {
export const prompt = async () => {
let dir = 'src';
console.log(`\nBuilding ${ yellow( name ) }, version ${ yellow( version ) }`)
const list = fs.readdirSync(path.join(__dirname, 'examples')).filter(d => /\d\d-/.test(d));
// Beginners example selection
if( prog.prompt ) srcDir = await utils.prompt()
console.log(`\nSelect which example you want to test:\n`);
c.info(`Compiler will compile ${ yellow( `./${ srcDir }/plugin.html` ) }`)
list.map((d, i) =>
console.log(` ${yellow(i + 1)}) ${ucfirst(d.replace(/^\d\d-/, '').replace(/-/g, ' '))}`),
);
reloadConfig()
console.log(`\n ${yellow(0)}) I want to develop ${yellow('my own plugin')}.\n`);
try {
const { value } = await prompts({
type: 'number',
name: 'value',
message: `Which example you want to launch? (press 0 - ${list.length}):`,
validate: value => Boolean(value >= 0 && value < list.length + 1),
});
// Basic assertions
assert( typeof config === 'object',
'Missing basic config object. Make sure you have valid '
+ 'config.js in src dir')
if (value > 0) {
dir = path.join('examples', list[value - 1]);
} else if (value === 0) {
console.log(`----------------------------------------------------
Please change ${yellow('package.json')} now:
assert( /^windy-plugin-/.test(name),
'Your repository (and also your published npm package) '
+ 'must be named "windy-plugin-AnyOfYourName".'
+ ' Change the name in your package.json')
${yellow('name')}: Must contain name of your plugin in a form windy-plugin-AnyName
${yellow('description')}: Should be description of what your plugin does
${yellow('author')}: Should contain your name
${yellow('repository')}: Should be actual link to your hosting repo
// Tasks
if( prog.watch || prog.build ) await build()
Also ${yellow('./README.md')} should contain some info about your plugin if you wish
if( prog.serve ) await startServer()
For faster work use directlly ${yellow('npm run start-dev')} to skip this prompt
if(prog.watch) {
c.start(`Staring watch on ${ gray( srcDir )}...`)
chokidar.watch([srcDir]).on('change', onChange )
}
After you will be done use ${yellow('npm publish')} to publish your plugin.
-----------------------------------------------------`);
}
return dir;
};
} catch(e) {
// Main
(async () => {
if (!fs.existsSync(path.join(__dirname, 'dist'))) {
fs.mkdirSync(path.join(__dirname, 'dist'));
}
console.log(`\nBuilding ${yellow(name)}, version ${yellow(version)}`);
c.error(`Error\u0007`,e)
// Beginners example selection
if (prog.prompt) {
srcDir = await prompt();
}
}
})();
c.info(`Compiler will compile ${yellow(`./${srcDir}/`)}`);
await reloadConfig();
function startServer() {
try {
// Basic assertions
assert(
typeof config === 'object',
'Missing basic config object. Make sure you have valid ' + 'config.js in src dir',
);
return new Promise( resolve => {
const httpsOptions = {
assert(
/^windy-plugin-/.test(name),
'Your repository (and also your published npm package) ' +
'must be named "windy-plugin-AnyOfYourName".' +
' Change the name in your package.json',
);
// https://www.ibm.com/support/knowledgecenter/en/SSWHYP_4.0.0/com.ibm.apimgmt.cmc.doc/task_apionprem_gernerate_self_signed_openSSL.html
key: fs.readFileSync( join(__dirname,'dev','key.pem'),'utf8' ),
cert: fs.readFileSync( join(__dirname,'dev','certificate.pem'), 'utf8' )
// Tasks
if (prog.watch || prog.build) {
await build();
}
if (prog.serve) {
await startServer();
}
if (prog.watch) {
c.start(
`Staring watch on ${gray(srcDir)} and ${gray(
'package.json',
)}. Build 1 sec after change....`,
);
chokidar
.watch([srcDir], {
awaitWriteFinish: { stabilityThreshold: 1000, pollInterval: 100 },
})
.on('change', onChange);
}
} catch (e) {
c.error(`Error\u0007`, e);
}
})();
app.use( express.static( 'dist' ) )
function startServer() {
return new Promise(resolve => {
const httpsOptions = {
// https://www.ibm.com/support/knowledgecenter/en/SSWHYP_4.0.0/com.ibm.apimgmt.cmc.doc/task_apionprem_gernerate_self_signed_openSSL.html
key: fs.readFileSync(path.join(__dirname, 'dev', 'key.pem'), 'utf8'),
cert: fs.readFileSync(path.join(__dirname, 'dev', 'certificate.pem'), 'utf8'),
};
https.createServer( httpsOptions, app)
.listen( port, () => {
app.use(express.static('dist'));
c.success(`Your plugin is published at ${ gray( `https://localhost:${ port }/plugin.js`) }.
Use ${ yellow( 'https://www.windy.com/dev' ) } to test it\n`)
resolve()
})
})
https.createServer(httpsOptions, app).listen(port, () => {
c.success(
`Your plugin is published at
${gray('https://localhost:' + port + '/plugin.js')}.
Use ${yellow('https://www.windy.com/dev')} to test it.\n`,
);
resolve();
});
});
}

@@ -120,140 +175,39 @@

Feel free to to use your own builder, transpiler, minifier or whatever
The result must be a single .js file with single W.loadPlugin() function
Feel free to to use your own builder, transpiler, minifier or whatever
The result must be a single .js file with single W.loadPlugin() function
Make sure to replace import XY from '@windy/XY' with W.require(XY)
Make sure to replace import XY from '@windy/XY' with W.require(XY)
*/
async function build() {
const destination = path.join(__dirname, 'dist');
const meta = {
name,
version,
author,
repository,
description,
...config,
};
// Riot parser options
const riotOpts = {
entities: true,
compact : false,
expr : true,
type : null,
template : null,
fileConfig : null,
concat : false,
modular: false,
debug: true
}
const { code } = await builder(name, srcDir, meta);
// Compile less - feel free to code your SCSS here
let css = await compileLess()
fs.writeFileSync(path.join(destination, 'plugin.js'), code);
const options = Object.assign({},{
name,
version,
author,
repository,
description },
config,
)
// Load source code of a plugin
const tagSrc = await fs.readFile( join(srcDir,'plugin.html'),'utf8')
// Compile it via riot compiler
// See: https://github.com/riot/compiler
const [ compiled ] = riot.compile(tagSrc,riotOpts)
let { html, js, imports } = compiled
const internalModules = {}
js = `\tconst plugin_version = "${ version }";\n${ js }`
//
// Rewrite imports into W.require
//
if( imports ) {
let match
, importsRegEx = /import\s+(\S+)\s+from\s+['"](@windy\/)?([^'"']+)['"]/g
while( ( match = importsRegEx.exec( imports ) ) !== null ) {
let [,lex,isCore,module] = match
// detect syntax "import graph from './soundingGraph.mjs'"
// and loads external module
if( !isCore ) module = await utils.externalMjs(srcDir,internalModules,module,name)
js = `\tconst ${ lex } = W.require('${ module }');\n${ js }`
}
}
// Stringify output
let output = utils.stringifyPlugin( options, html, css, js )
// Add external modules
for( let ext in internalModules ) {
output += `\n\n${ internalModules[ ext ] }`
}
// Save plugin to dest directory
const destination = join( __dirname, 'dist','plugin.js' )
// Babel traspile
if( prog.transpile ) {
c.info('Transpiling with babel')
let res = await babel.transformAsync( output,{
presets: ["@babel/preset-env"]
}) // => Promise<{ code, map, ast }>
output = res.code
}
await fs.outputFile(destination, output )
c.success(`Your plugin ${ gray( name ) } has been compiled to ${ gray( destination ) }`)
c.success(`Your plugin ${gray(name)} has been compiled to ${gray(destination)}`);
}
//
// L E S S compiler
//
async function compileLess() {
const lessOptions = {
cleancss: true,
compress: true,
};
const lessFile = join(srcDir,'plugin.less')
if(!fs.existsSync( lessFile ) ) return null
const lessSrc = await fs.readFile( lessFile,'utf8')
let { css } = await less.render( lessSrc, lessOptions )
return css
async function reloadConfig() {
const { default: dir } = await import(path.join(__dirname, srcDir, 'config.js'));
decache(dir);
config = dir;
return;
}
async function onChange(fullPath) {
c.info(`watch: File changed ${gray(fullPath)}`);
//
// Reload config
//
function reloadConfig() {
const dir = join( __dirname, srcDir, 'config.js' )
decache(dir)
config = require( dir )
}
await reloadConfig();
//
// Watch change of file
//
const onChange = async fullPath => {
c.info(`watch: File changed ${ gray( fullPath ) }`)
reloadConfig()
await build()
await build();
}

@@ -1,655 +0,1 @@

"use strict";
/**
* This is main plugin loading function
* Feel free to write your own compiler
*/
W.loadPlugin(
/* Mounting options */
{
"name": "windy-plugin-sun-position",
"version": "0.3.3",
"author": "Jochen Jacobs",
"repository": {
"type": "git",
"url": "git+https://github.com/jacobsjo/windy-plugin-sun-position"
},
"description": "Windy plugin that gives shows sun position on the map and gives details about sunset and sunrise times.",
"displayName": "Sun Position",
"hook": "contextmenu",
"dependencies": ["https://unpkg.com/d3@5.7.0/dist/d3.min.js", "https://unpkg.com/suncalc@1.8.0/suncalc.js", "https://unpkg.com/tz-lookup@6.1.25/tz.js"],
"className": "plugin-lhpane plugin-mobile-fullscreen",
"classNameMobile": "plugin-sun-position-mobile",
"exclusive": "lhpane"
},
/* HTML */
'<div class="mobile-header">Sun Details</div> <div class="plugin-content"> <div class="options"> <span class="image-checkbox" id="astroSun" title="Show sun details (astronomical)">&#x1f52d;</span>&nbsp; <span class="image-checkbox" id="photoSun" title="Show sun details (photography)">&#x1f4f7;</span>&nbsp; <span class="image-checkbox" id="moon" title="Show moon details">&#x263E;</span> </div> <div class="open-picker"> <h2>Picker not open</h2> Please open the weather picker to define position for sun-details. </div> <div class="sun-times" id="hide"> <div class="timeline"></div> <div class="current"> <div class="current-time" id="current_time">12:25</div> <svg class="sun-path"> <path id="sun_path"></path> <path id="moon_path"></path> <path id="horizon" d="M 0 50 H 200"></path> <circle class="path-circle" id="moon" cx="50" cy="50" r="4"></circle> <circle class="path-circle" id="sun" cx="50" cy="50" r="4"></circle> </svg> <div class="current-sun"> <span class="current-pos-title" id="sun">Sun</span><br> <span class="current-pos-label">Azimuth</span> <span class="current-pos" id="azimuth">0</span> <span class="current-pos-label">Altitude</span> <span class="current-pos" id="altitude">0</span> </div> <div class="current-moon"> <span class="current-pos-title" id="moon">Moon</span><br> <span class="current-pos-label">Azimuth</span> <span class="current-pos" id="azimuth-moon">0</span> <span class="current-pos-label">Altitude</span> <span class="current-pos" id="altitude-moon">0</span> <span class="current-pos-label">Phase</span> <span class="current-pos" id="phase-moon">full moon</span> <span class="current-pos-label">Illumination</span> <span class="current-pos" id="fraction-moon">100%</span> </div> </div> </div> <div class="footnote"> <a href="https://community.windy.com/topic/9017/sun-position-plugin">plugin page</a>&nbsp;&nbsp;&nbsp;<a href="https://www.npmjs.com/package/windy-plugin-sun-position">npm</a>&nbsp;&nbsp;&nbsp;<a href="https://github.com/jacobsjo/windy-plugin-sun-position">GitHub</a><br> windy-plugin-sun-position@<span class="plugin-version"></span><br> by Jochen Jacobs (@jacobsjo) <br> </div> </div>',
/* CSS */
'.onwindy-plugin-sun-position .left-border{left:270px}.onwindy-plugin-sun-position #search{display:none}#device-mobile .onwindy-plugin-sun-position .left-border{left:0}#device-mobile #bottom{z-index:2}.plugin-sun-position-mobile{position:absolute;top:250px;bottom:0px;width:100% !important}#device-mobile #windy-plugin-sun-position .plugin-content .footnote{margin-bottom:90px}#device-mobile #windy-plugin-sun-position .closing-x{display:block;right:0px;top:-1em}#device-mobile #windy-plugin-sun-position .open-picker,#device-mobile #windy-plugin-sun-position .sun-times{min-height:calc(100% - 120pt)}#windy-plugin-sun-position{width:270px;height:100%}#windy-plugin-sun-position .plugin-content{padding:15px 15px 15px 5px;font-size:14px;line-height:1.6;background-color:#404040;color:white}#windy-plugin-sun-position .plugin-content h2{color:white}#windy-plugin-sun-position .plugin-content .open-picker,#windy-plugin-sun-position .plugin-content .sun-times{min-height:calc(100% - 50pt)}#windy-plugin-sun-position .plugin-content .open-picker#hide,#windy-plugin-sun-position .plugin-content .sun-times#hide{display:none}#windy-plugin-sun-position .plugin-content .sun-times{width:250px;margin-top:10px;margin-left:auto;margin-right:auto}#windy-plugin-sun-position .plugin-content .sun-times .timeline-entry{position:relative}#windy-plugin-sun-position .plugin-content .sun-times .timeline-entry span{left:20px;display:inline-block;margin-bottom:0;padding-bottom:.5em}#windy-plugin-sun-position .plugin-content .sun-times .timeline-entry.timestamp{cursor:pointer}#windy-plugin-sun-position .plugin-content .sun-times .timeline-entry.timeframe{cursor:default}#windy-plugin-sun-position .plugin-content .sun-times .timeline-entry.timestamp::after{display:block;position:absolute;left:63px;top:0px;width:20px;height:20px;border-radius:10px;content:\' \'}#windy-plugin-sun-position .plugin-content .sun-times .timeline-entry.timestamp.minor::after{left:65px;top:2px;width:16px;height:16px;border-radius:8px}#windy-plugin-sun-position .plugin-content .sun-times .timeline-entry::before{content:"";position:absolute;left:71px;top:0px;border-left:4px solid;height:130%;width:3px}#windy-plugin-sun-position .plugin-content .sun-times .time-column{width:90px;text-align:right;padding-right:35px;color:white}#windy-plugin-sun-position .plugin-content .sun-times .nightColor{color:black}#windy-plugin-sun-position .plugin-content .sun-times .astroColor{color:#000030}#windy-plugin-sun-position .plugin-content .sun-times .nauticalColor{color:#121260}#windy-plugin-sun-position .plugin-content .sun-times .blueColor{color:blue}#windy-plugin-sun-position .plugin-content .sun-times .goldenColor{color:orange}#windy-plugin-sun-position .plugin-content .sun-times .dayColor{color:yellow}#windy-plugin-sun-position .plugin-content .sun-times .nightColor::after{background-color:black}#windy-plugin-sun-position .plugin-content .sun-times .astroColor::after{background-color:#000030}#windy-plugin-sun-position .plugin-content .sun-times .nauticalColor::after{background-color:#121260}#windy-plugin-sun-position .plugin-content .sun-times .blueColor::after{background-color:blue}#windy-plugin-sun-position .plugin-content .sun-times .goldenColor::after{background-color:orange}#windy-plugin-sun-position .plugin-content .sun-times .dayColor::after{background-color:yellow}#windy-plugin-sun-position .plugin-content .sun-times .nightColor::before{border-left-color:black}#windy-plugin-sun-position .plugin-content .sun-times .astroColor::before{border-left-color:#000030}#windy-plugin-sun-position .plugin-content .sun-times .nauticalColor::before{border-left-color:#121260}#windy-plugin-sun-position .plugin-content .sun-times .blueColor::before{border-left-color:blue}#windy-plugin-sun-position .plugin-content .sun-times .goldenColor::before{border-left-color:orange}#windy-plugin-sun-position .plugin-content .sun-times .dayColor::before{border-left-color:yellow}#windy-plugin-sun-position .plugin-content .sun-times .moon{color:gray}#windy-plugin-sun-position .plugin-content .sun-times .moon::after{background-color:gray}#windy-plugin-sun-position .plugin-content .sun-times .current-time{font-size:25pt;text-align:center}#windy-plugin-sun-position .plugin-content .sun-times .current-sun,#windy-plugin-sun-position .plugin-content .sun-times .current-moon{padding-top:10pt;padding-bottom:10pt;border-radius:10pt;margin-top:5pt;margin-bottom:5pt;background-color:#505050}#windy-plugin-sun-position .plugin-content .sun-times .current-sun.hide,#windy-plugin-sun-position .plugin-content .sun-times .current-moon.hide{display:none}#windy-plugin-sun-position .plugin-content .sun-times .current-pos-title{display:inline-block;margin-left:60pt;padding-bottom:10pt}#windy-plugin-sun-position .plugin-content .sun-times .current-pos-title::before{content:" ";display:inline-block;width:15pt;height:15pt;margin-bottom:-4pt;border-radius:7pt;margin-right:10pt}#windy-plugin-sun-position .plugin-content .sun-times .current-pos-title#sun::before{background-color:yellow}#windy-plugin-sun-position .plugin-content .sun-times .current-pos-title#moon::before{background-color:gray}#windy-plugin-sun-position .plugin-content .sun-times .current-pos{display:inline-block;width:60%;text-align:left;padding-left:10pt}#windy-plugin-sun-position .plugin-content .sun-times .current-pos-label{display:inline-block;width:35%;text-align:right}#windy-plugin-sun-position .plugin-content .sun-times .sun-path{width:200px;height:100px;margin-left:25px}#windy-plugin-sun-position .plugin-content .sun-times .sun-path path{fill:none;stroke:#606060;stroke-width:2px}#windy-plugin-sun-position .plugin-content .sun-times .sun-path path#sun_path{stroke-dasharray:10 2 1 2}#windy-plugin-sun-position .plugin-content .sun-times .sun-path path#moon_path{stroke-dasharray:0 1 2 2 3 2 3 1}#windy-plugin-sun-position .plugin-content .sun-times .path-circle#sun{fill:yellow}#windy-plugin-sun-position .plugin-content .sun-times .path-circle#moon{fill:gray}#windy-plugin-sun-position .plugin-content .options{text-align:center;margin-bottom:20pt}#windy-plugin-sun-position .plugin-content .options .image-checkbox{font-size:22pt;color:#404040;text-align:center;display:inline-block;width:30pt;height:30pt;border-radius:15pt;font-family:"Symbola";cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-khtml-user-select:none;-ms-user-select:none}#windy-plugin-sun-position .plugin-content .options .image-checkbox#photoSun,#windy-plugin-sun-position .plugin-content .options .image-checkbox#astroSun{background:#C0C000}#windy-plugin-sun-position .plugin-content .options .image-checkbox#moon{background:#C0C0C0}#windy-plugin-sun-position .plugin-content .options .image-checkbox.off{background:#505050 !important}#windy-plugin-sun-position .plugin-content .footnote{color:gray;font-size:8pt;width:150pt;margin-left:auto;margin-right:auto}#windy-plugin-sun-position .plugin-content .footnote a{text-decoration:underline}.windy-plugin-sun-position.sun-position-dial{position:absolute;left:-99.5px;top:25.5px;width:199px;height:199px;pointer-events:none}.windy-plugin-sun-position.sun-position-dial .dial-line-sun{stroke:rgba(68,65,65,0.84);stroke-width:3}.windy-plugin-sun-position.sun-position-dial .dial-line-moon{stroke:rgba(68,65,65,0.84);stroke-width:3}.windy-plugin-sun-position.sun-position-dial .dial-circle-sun{fill:yellow}.windy-plugin-sun-position.sun-position-dial .dial-circle-moon{fill:gray}.windy-plugin-sun-position.sun-position-dial .dial-line-sunrise,.windy-plugin-sun-position.sun-position-dial .dial-line-sunset,.windy-plugin-sun-position.sun-position-dial .dial-line-moonrise,.windy-plugin-sun-position.sun-position-dial .dial-line-moonset{stroke:rgba(68,65,65,0.84);stroke-width:2;stroke-dasharray:10 2 1 2;pointer-events:auto}.windy-plugin-sun-position.sun-position-dial .dial-line-moonrise,.windy-plugin-sun-position.sun-position-dial .dial-line-moonset{stroke-dasharray:0 1 2 2 3 2 3 1}.windy-plugin-sun-position.sun-position-dial #hover.dial-line-sunrise,.windy-plugin-sun-position.sun-position-dial #hover.dial-line-sunset,.windy-plugin-sun-position.sun-position-dial #hover.dial-line-moonrise,.windy-plugin-sun-position.sun-position-dial #hover.dial-line-moonset{stroke-width:4}#device-mobile .windy-plugin-sun-position.sun-position-dial{top:.5px;left:-69.5px;width:139px;height:139px}#device-mobile .windy-plugin-sun-position.sun-position-dial .dial-line-sun,#device-mobile .windy-plugin-sun-position.sun-position-dial .dial-line-moon{stroke-width:5}#device-mobile .windy-plugin-sun-position.sun-position-dial .dial-line-sunrise,#device-mobile .windy-plugin-sun-position.sun-position-dial .dial-line-sunset,#device-mobile .windy-plugin-sun-position.sun-position-dial .dial-line-moonrise,#device-mobile .windy-plugin-sun-position.sun-position-dial .dial-line-moonset{stroke-width:4}',
/* Constructor */
function () {
var _this = this;
var broadcast = W.require('broadcast');
var location = W.require('location');
var map = W.require('map');
var store = W.require('store');
var utils = W.require('utils');
var picker = W.require('picker');
var plugin_version = "0.3.3";
this.hasURL = true;
var setQs = function setQs(qs) {
location.setUrl("plugins/".concat(_this.ident, "?").concat(qs));
};
var plugin_options = {
"photoSun": true,
"astroSun": true,
"moon": true
};
var setPluginOption = function setPluginOption(option, setting) {
if (setting === undefined || setting === '' || setting === null) return;
plugin_options[option] = setting === 'true';
};
var params = new URLSearchParams(this.query);
setPluginOption('photoSun', params.get('photoSun'));
setPluginOption('astroSun', params.get('astroSun'));
setPluginOption('moon', params.get('moon'));
console.log(plugin_options);
var updateQs = function updateQs() {
setQs("photoSun=" + plugin_options.photoSun + "&astroSun=" + plugin_options.astroSun + "&moon=" + plugin_options.moon);
};
var mod = function mod(x, n) {
return (x % n + n) % n;
};
var lineLength = 80;
var sunTimesConfigPhotography = {
"dawn": {
starts: "Blue Hour",
new_class: "blueColor"
},
"blueHourEnd": {
starts: "Golden Hour",
new_class: "goldenColor"
},
"sunrise": {
name: "Sunrise",
"class": "minor"
},
"goldenHourEnd": {
starts: "Daytime",
new_class: "dayColor"
},
"solarNoon": {
name: "Solar Noon",
"class": "minor"
},
"goldenHour": {
starts: "Golden Hour",
new_class: "goldenColor"
},
"sunset": {
name: "Sunset",
"class": "minor"
},
"blueHour": {
starts: "Blue Hour",
new_class: "blueColor"
},
"dusk": {
starts: "Nighttime",
new_class: "nightColor"
},
"first": [{
altitude: -90,
starts: "Nighttime",
new_class: "nightColor"
}, {
altitude: -6,
starts: "Blue Hour",
new_class: "blueColor"
}, {
altitude: -4,
starts: "Golden Hour",
new_class: "goldenColor"
}, {
altitude: 6,
starts: "Daytime",
new_class: "dayColor"
}]
};
var sunTimesConfigAstonomical = {
"nightEnd": {
name: "Astronomical Dawn",
starts: "Astronomical Twilight",
new_class: "astroColor"
},
"nauticalDawn": {
name: "Nautical Dawn",
starts: "Nautical Twilight",
new_class: "nauticalColor"
},
"dawn": {
name: "Civil Dawn",
starts: "Civil Twilight",
new_class: "blueColor"
},
"sunrise": {
name: "Sunrise",
starts: "Daytime",
new_class: "dayColor"
},
"solarNoon": {
name: "Solar Noon",
"class": "minor"
},
"sunset": {
name: "Sunset",
starts: "Civil Twilight",
new_class: "blueColor"
},
"dusk": {
name: "Civil Dusk",
starts: "Nautical Twilight",
new_class: "nauticalColor"
},
"nauticalDusk": {
name: "Nautical Dusk",
starts: "Astronomical Twilight",
new_class: "astroColor"
},
"night": {
name: "Astronomical Dusk",
starts: "Nighttime",
new_class: "nightColor"
},
"first": [{
altitude: -90,
starts: "Nighttime",
new_class: "nightColor"
}, {
altitude: -18,
starts: "Astronomical Twilight",
new_class: "astroColor"
}, {
altitude: -12,
starts: "Nautical Twilight",
new_class: "nauticalColor"
}, {
altitude: -6,
starts: "Civil Twilight",
new_class: "blueColor"
}, {
altitude: -0.833,
starts: "Daytime",
new_class: "dayColor"
}]
};
var sunTimesConfigCombinded = {
"nightEnd": {
name: "Astronomical Dawn",
starts: "Astronomical Twilight",
new_class: "astroColor"
},
"nauticalDawn": {
name: "Nautical Dawn",
starts: "Nautical Twilight",
new_class: "nauticalColor"
},
"dawn": {
name: "Civil Dawn",
starts: "Blue Hour",
new_class: "blueColor"
},
"blueHourEnd": {
starts: "Golden Hour",
new_class: "goldenColor"
},
"sunrise": {
name: "Sunrise",
"class": "minor"
},
"goldenHourEnd": {
starts: "Daytime",
new_class: "dayColor"
},
"solarNoon": {
name: "Solar Noon",
"class": "minor"
},
"goldenHour": {
starts: "Golden Hour",
new_class: "goldenColor"
},
"sunset": {
name: "Sunset",
"class": "minor"
},
"blueHour": {
starts: "Blue Hour",
new_class: "blueColor"
},
"dusk": {
name: "Civil Dusk",
starts: "Nautical Twilight",
new_class: "nauticalColor"
},
"nauticalDusk": {
name: "Nautical Dusk",
starts: "Astronomical Twilight",
new_class: "astroColor"
},
"night": {
name: "Astronomical Dusk",
starts: "Nighttime",
new_class: "nightColor"
},
"first": [{
altitude: -90,
starts: "Nighttime",
new_class: "nightColor"
}, {
altitude: -18,
starts: "Astronomical Twilight",
new_class: "astroColor"
}, {
altitude: -12,
starts: "Nautical Twilight",
new_class: "nauticalColor"
}, {
altitude: -6,
starts: "Blue Hour",
new_class: "blueColor"
}, {
altitude: -4,
starts: "Golden Hour",
new_class: "goldenColor"
}, {
altitude: 6,
starts: "Daytime",
new_class: "dayColor"
}]
};
var sunTimesConfigNone = {
"first": [{
altitude: -90,
starts: " ",
new_class: "nightColor"
}]
};
var moonTimesConfig = {
"rise": {
name: "Moonrise",
"class": "moon"
},
"set": {
name: "Moonset",
"class": "moon"
}
};
var quarterOffet = 0.01;
var moonPhases = [];
moonPhases[0] = "New Moon";
moonPhases[quarterOffet] = "Waxing Crescent";
moonPhases[0.25 - quarterOffet] = "First Quarter", moonPhases[0.25 + quarterOffet] = "Waxing Gibbous", moonPhases[0.5 - quarterOffet] = "Full Moon", moonPhases[0.5 + quarterOffet] = "Waning Gibbous", moonPhases[0.75 - quarterOffet] = "Last Quarter", moonPhases[0.75 + quarterOffet] = "Waning Crescent", moonPhases[1 - quarterOffet] = "New Moon";
var isOpen = false;
SunCalc.addTime(-4, "blueHourEnd", "blueHour");
d3.selectAll("#windy-plugin-sun-position .options .image-checkbox").on("click", function () {
var checkbox = d3.select(this);
plugin_options[checkbox.attr("id")] = checkbox.classed("off");
checkbox.classed("off", !checkbox.classed("off"));
updateQs();
movedPickerRedraw();
});
this.onopen = function () {
if (isOpen) return;
isOpen = true;
if (!d3.select(".picker").empty() && d3.select(".picker").style("display") != "none") {
onPickerOpened();
movedPickerRedraw();
}
;
d3.select(".plugin-content .footnote .plugin-version").html(plugin_version);
updateQs();
d3.select("#windy-plugin-sun-position .options .image-checkbox#photoSun").classed("off", !plugin_options.photoSun);
d3.select("#windy-plugin-sun-position .options .image-checkbox#astroSun").classed("off", !plugin_options.astroSun);
d3.select("#windy-plugin-sun-position .options .image-checkbox#moon").classed("off", !plugin_options.moon);
};
this.onclose = function () {
isOpen = false;
d3.select(".picker").select("svg").remove();
};
var readValues = function readValues(latLon) {
pickerOpen = true;
redraw(latLon);
};
var svg;
var sunLine;
var sunriseLine;
var sunsetLine;
var sunCircle;
var moonLine;
var moonriseLine;
var moonsetLine;
var moonCircle;
var timezone = 'UTC';
var useUTC = false;
var onPickerOpened = function onPickerOpened() {
updateQs();
d3.select(".picker").select("svg").remove();
var p = d3.select(".picker");
svg = p.append("svg").attr("class", "windy-plugin-sun-position sun-position-dial").attr("viewBox", "0 0 199 199");
sunriseLine = svg.append("line").attr("class", "dial-line dial-line-sunrise").attr("x1", 100).attr("y1", 100).attr("x2", 100).attr("y2", 100).on("click", function (d) {
setTime("sunrise");
});
sunsetLine = svg.append("line").attr("class", "dial-line dial-line-sunset").attr("x1", 100).attr("y1", 100).attr("x2", 100).attr("y2", 100).on("click", function (d) {
setTime("sunset");
});
moonriseLine = svg.append("line").attr("class", "dial-line dial-line-moonrise").attr("x1", 100).attr("y1", 100).attr("x2", 100).attr("y2", 100).on("click", function (d) {
setTime("moonrise");
});
moonsetLine = svg.append("line").attr("class", "dial-line dial-line-moonset").attr("x1", 100).attr("y1", 100).attr("x2", 100).attr("y2", 100).on("click", function (d) {
setTime("moonset");
});
moonLine = svg.append("line").attr("class", "dial-line dial-line-moon").attr("x1", 100).attr("y1", 100).attr("x2", 100).attr("y2", 100);
moonCircle = svg.append("circle").attr("class", "dial-circle dial-circle-moon").attr("r", 4).attr("cx", 100).attr("cy", 100);
sunLine = svg.append("line").attr("class", "dial-line dial-line-sun").attr("x1", 100).attr("y1", 100).attr("x2", 100).attr("y2", 100);
sunCircle = svg.append("circle").attr("class", "dial-circle dial-circle-sun").attr("r", 4).attr("cx", 100).attr("cy", 100);
d3.selectAll(".dial-line").on("mouseover", function (d) {
d3.select(this).attr("id", "hover");
}).on("mouseout", function (d) {
d3.select(this).attr("id", "");
});
d3.select(".sun-times").attr("id", "");
d3.select(".open-picker").attr("id", "hide");
console.log(plugin_options.photoSun);
console.log(!plugin_options.photoSun);
};
var lastLatLon = undefined;
var movedPickerRedraw = function movedPickerRedraw(latLon) {
if (latLon !== undefined) lastLatLon = latLon;
redraw(lastLatLon);
};
var times;
var moonTimes;
var redraw = function redraw(latLon) {
var time = store.get('timestamp');
var lat = latLon.lat;
var lon = latLon.lon;
if (store.get('zuluMode')) {
timezone = 'UTC';
} else {
timezone = tzlookup(lat, lon);
}
times = SunCalc.getTimes(time, lat, lon);
var sunPos = SunCalc.getPosition(time, lat, lon);
var sunrisePos = SunCalc.getPosition(times.sunrise, lat, lon);
var sunsetPos = SunCalc.getPosition(times.sunset, lat, lon);
var moonTimes1 = SunCalc.getMoonTimes(times.nadir.getTime(), lat, lon);
var moonTimes2 = SunCalc.getMoonTimes(times.nadir.getTime() + 24 * 60 * 60 * 1000, lat, lon);
moonTimes = {};
moonTimes.rise = moonTimes1.rise >= times.nadir.getTime() ? moonTimes1.rise : moonTimes2.rise <= times.nadir.getTime() + 24 * 60 * 60 * 1000 ? moonTimes2.rise : NaN;
moonTimes.set = moonTimes1.set >= times.nadir.getTime() ? moonTimes1.set : moonTimes2.set <= times.nadir.getTime() + 24 * 60 * 60 * 1000 ? moonTimes2.set : NaN;
var moonPos = SunCalc.getMoonPosition(time, lat, lon);
var moonrisePos = SunCalc.getMoonPosition(moonTimes.rise, lat, lon);
var moonsetPos = SunCalc.getMoonPosition(moonTimes.set, lat, lon);
var sunLineLength;
var sunLineOpacity;
if (sunPos.altitude > 0) {
sunLineLength = Math.cos(sunPos.altitude) * lineLength;
sunLineOpacity = 1;
} else if (sunPos.altitude > -0.1) {
sunLineLength = lineLength;
sunLineOpacity = 1 + 10.0 * sunPos.altitude;
} else {
sunLineLength = lineLength;
sunLineOpacity = 0;
}
if (plugin_options.astroSun || plugin_options.photoSun) {
sunLine.attr("x2", 100 - Math.sin(sunPos.azimuth) * sunLineLength).attr("y2", 100 + Math.cos(sunPos.azimuth) * sunLineLength).attr("stroke-opacity", sunLineOpacity);
sunCircle.attr("cx", 100 - Math.sin(sunPos.azimuth) * sunLineLength / 2).attr("cy", 100 + Math.cos(sunPos.azimuth) * sunLineLength / 2).attr("fill-opacity", sunLineOpacity);
if (isNaN(sunrisePos.azimuth)) {
sunriseLine.attr("x2", 100).attr("y2", 100);
sunsetLine.attr("x2", 100).attr("y2", 100);
} else {
sunriseLine.attr("x2", 100 - Math.sin(sunrisePos.azimuth) * lineLength).attr("y2", 100 + Math.cos(sunrisePos.azimuth) * lineLength);
sunsetLine.attr("x2", 100 - Math.sin(sunsetPos.azimuth) * lineLength).attr("y2", 100 + Math.cos(sunsetPos.azimuth) * lineLength);
}
} else {
sunLine.attr("x2", 100).attr("y2", 100);
sunriseLine.attr("x2", 100).attr("y2", 100);
sunsetLine.attr("x2", 100).attr("y2", 100);
sunCircle.attr("fill-opacity", 0);
}
var moonLineLength;
var moonLineOpacity;
if (moonPos.altitude > 0) {
moonLineLength = Math.cos(moonPos.altitude) * lineLength;
moonLineOpacity = 1;
} else if (moonPos.altitude > -0.02) {
moonLineLength = lineLength;
moonLineOpacity = 1 + 50.0 * moonPos.altitude;
} else {
moonLineLength = lineLength;
moonLineOpacity = 0;
}
if (plugin_options.moon) {
moonLine.attr("x2", 100 - Math.sin(moonPos.azimuth) * moonLineLength).attr("y2", 100 + Math.cos(moonPos.azimuth) * moonLineLength).attr("stroke-opacity", moonLineOpacity);
moonCircle.attr("cx", 100 - Math.sin(moonPos.azimuth) * moonLineLength / 2).attr("cy", 100 + Math.cos(moonPos.azimuth) * moonLineLength / 2).attr("fill-opacity", moonLineOpacity);
if (isNaN(moonrisePos.azimuth)) {
moonriseLine.attr("x2", 100).attr("y2", 100);
} else {
moonriseLine.attr("x2", 100 - Math.sin(moonrisePos.azimuth) * lineLength).attr("y2", 100 + Math.cos(moonrisePos.azimuth) * lineLength);
}
if (isNaN(moonsetPos.azimuth)) {
moonsetLine.attr("x2", 100).attr("y2", 100);
} else {
moonsetLine.attr("x2", 100 - Math.sin(moonsetPos.azimuth) * lineLength).attr("y2", 100 + Math.cos(moonsetPos.azimuth) * lineLength);
}
} else {
moonLine.attr("x2", 100).attr("y2", 100);
moonriseLine.attr("x2", 100).attr("y2", 100);
moonsetLine.attr("x2", 100).attr("y2", 100);
moonCircle.attr("fill-opacity", 0);
}
var sunTimesConfig = plugin_options.astroSun ? plugin_options.photoSun ? sunTimesConfigCombinded : sunTimesConfigAstonomical : plugin_options.photoSun ? sunTimesConfigPhotography : sunTimesConfigNone;
var minAltitude = SunCalc.getPosition(times.nadir, lat, lon).altitude * 180 / Math.PI;
var maxAltitude = SunCalc.getPosition(times.solarNoon, lat, lon).altitude * 180 / Math.PI;
var timeline = [];
var firstConfig;
for (i in sunTimesConfig.first) {
if (sunTimesConfig.first[i].altitude > minAltitude) {
break;
}
firstConfig = sunTimesConfig.first[i];
}
timeline.push({
time: 0,
name: undefined,
raw_name: undefined,
starts: firstConfig.starts,
color_class: undefined,
new_class: firstConfig.new_class
});
for (var timeName in times) {
if (sunTimesConfig[timeName] && !isNaN(times[timeName])) {
timeline.push({
time: times[timeName],
name: sunTimesConfig[timeName].name,
raw_name: timeName,
starts: sunTimesConfig[timeName].starts,
"class": sunTimesConfig[timeName]["class"],
new_class: sunTimesConfig[timeName].new_class
});
}
}
if (plugin_options.moon) {
for (var timeName in moonTimes) {
if (moonTimesConfig[timeName] && !isNaN(moonTimes[timeName])) {
timeline.push({
time: moonTimes[timeName],
name: moonTimesConfig[timeName].name,
raw_name: "moon" + timeName,
"class": moonTimesConfig[timeName]["class"]
});
}
}
}
timeline.sort(function (a, b) {
return a.time > b.time ? 1 : -1;
});
var tlo = d3.select(".sun-times .timeline").html("");
var current_class = "";
for (var i in timeline) {
if (timeline[i].new_class) {
current_class = timeline[i].new_class;
}
if (timeline[i].time > 0) {
var tle = tlo.append("div").attr("class", "timeline-entry timestamp " + (timeline[i]["class"] ? timeline[i]["class"] + " " : "") + current_class);
tle.append("span").attr("class", "time-column").html(time_format(timeline[i].time));
tle.append("span").attr("class", "name-column").html(timeline[i].name);
tle.data([timeline[i].raw_name]).on("click", function (d) {
setTime(d);
});
}
if (timeline[i].starts) {
var tle = tlo.append("div").attr("class", "timeline-entry timeframe " + current_class);
tle.append("span").attr("class", "time-column");
tle.append("span").attr("class", "name-column").html(timeline[i].starts);
}
}
document.getElementById('current_time').innerHTML = time_format(new Date(time));
document.getElementById('azimuth').innerHTML = (sunPos.azimuth * 180 / Math.PI).toFixed(1) + "&deg;";
document.getElementById('altitude').innerHTML = (sunPos.altitude * 180 / Math.PI).toFixed(1) + "&deg;";
var moonIllumination = SunCalc.getMoonIllumination(time);
var phaseName;
for (var phase in moonPhases) {
if (phase < moonIllumination.phase) {
phaseName = moonPhases[phase];
}
}
document.getElementById('azimuth-moon').innerHTML = (moonPos.azimuth * 180 / Math.PI).toFixed(1) + "&deg;";
document.getElementById('altitude-moon').innerHTML = (moonPos.altitude * 180 / Math.PI).toFixed(1) + "&deg;";
document.getElementById('phase-moon').innerHTML = phaseName;
document.getElementById('fraction-moon').innerHTML = (moonIllumination.fraction * 100).toFixed(1) + "%";
d3.select(".current-sun").classed("hide", !(plugin_options.astroSun || plugin_options.photoSun));
d3.select(".current-moon").classed("hide", !plugin_options.moon);
var data = [];
var moonData = [];
var t = times.nadir.getTime();
var steps = 100;
var stepSize = 24.0 * 60 * 60 * 1000 / steps;
for (var i = 0; i <= steps; i++) {
data[i] = {
x: 1.0 * i / steps,
y: -SunCalc.getPosition(t + stepSize * i, lat, lon).altitude
};
moonData[i] = {
x: 1.0 * i / steps,
y: -SunCalc.getMoonPosition(t + stepSize * i, lat, lon).altitude
};
}
var line = d3.line().x(function (d) {
return d['x'] * 200;
}).y(function (d) {
return (d['y'] + Math.PI / 2) * 100 / Math.PI;
});
d3.select('#sun_path').attr('d', plugin_options.astroSun || plugin_options.photoSun ? line(data) : "");
d3.select('#moon_path').attr('d', plugin_options.moon ? line(moonData) : "");
d3.select('.path-circle#sun').attr('cx', mod((time - t) * 200.0 / (24.0 * 60 * 60 * 1000), 200)).attr('cy', (-sunPos.altitude + Math.PI / 2) * 100 / Math.PI).style('opacity', plugin_options.astroSun || plugin_options.photoSun ? 1 : 0);
d3.select('.path-circle#moon').attr('cx', mod((time - t) * 200.0 / (24.0 * 60 * 60 * 1000), 200)).attr('cy', (-moonPos.altitude + Math.PI / 2) * 100 / Math.PI).style('opacity', plugin_options.moon ? 1 : 0);
};
function time_format(d) {
if (isNaN(d)) {
return "--:--" + (store.get('zuluMode') ? "Z" : "");
}
var d_local = new Date(new Date(d.getTime()).toLocaleString("en-US", {
timeZone: timezone
}));
var hours = format_two_digits(d_local.getHours());
var minutes = format_two_digits(d_local.getMinutes());
return hours + ":" + minutes + (store.get('zuluMode') ? "Z" : "");
}
function format_two_digits(n) {
return n < 10 ? '0' + n : n;
}
var setTime = function setTime(timeString) {
var time = store.get('timestamp');
if (timeString.substring(0, 4) == "moon") {
store.set('timestamp', moonTimes[timeString.substring(4)].getTime());
} else {
store.set('timestamp', times[timeString].getTime());
}
};
picker.on('pickerOpened', function (latLon) {
if (!isOpen) return;
onPickerOpened();
movedPickerRedraw(latLon);
});
picker.on('pickerMoved', function (latLon) {
if (!isOpen) return;
movedPickerRedraw(latLon);
});
picker.on('pickerClosed', function () {
d3.select(".sun-times").attr("id", "hide");
d3.select(".open-picker").attr("id", "");
d3.select(".picker").select("svg").remove();
});
store.on('timestamp', function (ts) {
movedPickerRedraw();
});
});
W.loadPlugin({name:"windy-plugin-sun-position",version:"0.3.6",author:"Jochen Jacobs",repository:{type:"git",url:"git+https://github.com/jacobsjo/windy-plugin-sun-position"},description:"Windy plugin that gives shows sun position on the map and gives details about sunset and sunrise times.",displayName:"Sun Position",hook:"contextmenu",dependencies:["https://unpkg.com/d3@5.7.0/dist/d3.min.js","https://unpkg.com/suncalc@1.8.0/suncalc.js","https://unpkg.com/tz-lookup@6.1.25/tz.js"],className:"plugin-lhpane plugin-mobile-fullscreen",classNameMobile:"plugin-sun-position-mobile",exclusive:"lhpane"},["picker","store"],(function(n,t,i){const o={photoSun:!0,astroSun:!0,moon:!0};console.log(o);const s=(n,t)=>(n%t+t)%t,e=80,l={dawn:{starts:"Blue Hour",new_class:"blueColor"},blueHourEnd:{starts:"Golden Hour",new_class:"goldenColor"},sunrise:{name:"Sunrise",class:"minor"},goldenHourEnd:{starts:"Daytime",new_class:"dayColor"},solarNoon:{name:"Solar Noon",class:"minor"},goldenHour:{starts:"Golden Hour",new_class:"goldenColor"},sunset:{name:"Sunset",class:"minor"},blueHour:{starts:"Blue Hour",new_class:"blueColor"},dusk:{starts:"Nighttime",new_class:"nightColor"},first:[{altitude:-90,starts:"Nighttime",new_class:"nightColor"},{altitude:-6,starts:"Blue Hour",new_class:"blueColor"},{altitude:-4,starts:"Golden Hour",new_class:"goldenColor"},{altitude:6,starts:"Daytime",new_class:"dayColor"}]},a={nightEnd:{name:"Astronomical Dawn",starts:"Astronomical Twilight",new_class:"astroColor"},nauticalDawn:{name:"Nautical Dawn",starts:"Nautical Twilight",new_class:"nauticalColor"},dawn:{name:"Civil Dawn",starts:"Civil Twilight",new_class:"blueColor"},sunrise:{name:"Sunrise",starts:"Daytime",new_class:"dayColor"},solarNoon:{name:"Solar Noon",class:"minor"},sunset:{name:"Sunset",starts:"Civil Twilight",new_class:"blueColor"},dusk:{name:"Civil Dusk",starts:"Nautical Twilight",new_class:"nauticalColor"},nauticalDusk:{name:"Nautical Dusk",starts:"Astronomical Twilight",new_class:"astroColor"},night:{name:"Astronomical Dusk",starts:"Nighttime",new_class:"nightColor"},first:[{altitude:-90,starts:"Nighttime",new_class:"nightColor"},{altitude:-18,starts:"Astronomical Twilight",new_class:"astroColor"},{altitude:-12,starts:"Nautical Twilight",new_class:"nauticalColor"},{altitude:-6,starts:"Civil Twilight",new_class:"blueColor"},{altitude:-.833,starts:"Daytime",new_class:"dayColor"}]},u={nightEnd:{name:"Astronomical Dawn",starts:"Astronomical Twilight",new_class:"astroColor"},nauticalDawn:{name:"Nautical Dawn",starts:"Nautical Twilight",new_class:"nauticalColor"},dawn:{name:"Civil Dawn",starts:"Blue Hour",new_class:"blueColor"},blueHourEnd:{starts:"Golden Hour",new_class:"goldenColor"},sunrise:{name:"Sunrise",class:"minor"},goldenHourEnd:{starts:"Daytime",new_class:"dayColor"},solarNoon:{name:"Solar Noon",class:"minor"},goldenHour:{starts:"Golden Hour",new_class:"goldenColor"},sunset:{name:"Sunset",class:"minor"},blueHour:{starts:"Blue Hour",new_class:"blueColor"},dusk:{name:"Civil Dusk",starts:"Nautical Twilight",new_class:"nauticalColor"},nauticalDusk:{name:"Nautical Dusk",starts:"Astronomical Twilight",new_class:"astroColor"},night:{name:"Astronomical Dusk",starts:"Nighttime",new_class:"nightColor"},first:[{altitude:-90,starts:"Nighttime",new_class:"nightColor"},{altitude:-18,starts:"Astronomical Twilight",new_class:"astroColor"},{altitude:-12,starts:"Nautical Twilight",new_class:"nauticalColor"},{altitude:-6,starts:"Blue Hour",new_class:"blueColor"},{altitude:-4,starts:"Golden Hour",new_class:"goldenColor"},{altitude:6,starts:"Daytime",new_class:"dayColor"}]},r={first:[{altitude:-90,starts:" ",new_class:"nightColor"}]},p={rise:{name:"Moonrise",class:"moon"},set:{name:"Moonset",class:"moon"}},c=[];c[0]="New Moon",c[.01]="Waxing Crescent",c[.24]="First Quarter",c[.26]="Waxing Gibbous",c[.49]="Full Moon",c[.51]="Waning Gibbous",c[.74]="Last Quarter",c[.76]="Waning Crescent",c[.99]="New Moon";let d=!1;SunCalc.addTime(-4,"blueHourEnd","blueHour");let m;let g,h,w,y,b,f,x,k,C,v,_,M="UTC";function S(){d3.select(".picker").select("svg").remove();const n=d3.select(".picker");g=n.append("svg").attr("class","windy-plugin-sun-position sun-position-dial").attr("viewBox","0 0 199 199"),w=g.append("line").attr("class","dial-line dial-line-sunrise").attr("x1",100).attr("y1",100).attr("x2",100).attr("y2",100).on("click",(function(){H("sunrise")})),y=g.append("line").attr("class","dial-line dial-line-sunset").attr("x1",100).attr("y1",100).attr("x2",100).attr("y2",100).on("click",(function(){H("sunset")})),x=g.append("line").attr("class","dial-line dial-line-moonrise").attr("x1",100).attr("y1",100).attr("x2",100).attr("y2",100).on("click",(function(){H("moonrise")})),k=g.append("line").attr("class","dial-line dial-line-moonset").attr("x1",100).attr("y1",100).attr("x2",100).attr("y2",100).on("click",(function(){H("moonset")})),f=g.append("line").attr("class","dial-line dial-line-moon").attr("x1",100).attr("y1",100).attr("x2",100).attr("y2",100),C=g.append("circle").attr("class","dial-circle dial-circle-moon").attr("r",4).attr("cx",100).attr("cy",100),h=g.append("line").attr("class","dial-line dial-line-sun").attr("x1",100).attr("y1",100).attr("x2",100).attr("y2",100),b=g.append("circle").attr("class","dial-circle dial-circle-sun").attr("r",4).attr("cx",100).attr("cy",100),d3.selectAll(".dial-line").on("mouseover",(function(){d3.select(this).attr("id","hover")})).on("mouseout",(function(){d3.select(this).attr("id","")})),d3.select(".sun-times").attr("id",""),d3.select(".open-picker").attr("id","hide")}function N(n){void 0!==n&&(m=n),void 0!==m&&function(n){const t=i.get("timestamp"),d=n.lat,m=n.lon;M=i.get("zuluMode")?"UTC":tzlookup(d,m);v=SunCalc.getTimes(t,d,m);const g=SunCalc.getPosition(t,d,m),S=SunCalc.getPosition(v.sunrise,d,m),N=SunCalc.getPosition(v.sunset,d,m),T=SunCalc.getMoonTimes(v.nadir.getTime(),d,m),D=SunCalc.getMoonTimes(v.nadir.getTime()+864e5,d,m);_={},_.rise=T.rise>=v.nadir.getTime()?T.rise:D.rise<=v.nadir.getTime()+864e5?D.rise:NaN,_.set=T.set>=v.nadir.getTime()?T.set:D.set<=v.nadir.getTime()+864e5?D.set:NaN;const P=SunCalc.getMoonPosition(t,d,m),I=SunCalc.getMoonPosition(_.rise,d,m),A=SunCalc.getMoonPosition(_.set,d,m);let E,B,j,G;g.altitude>0?(E=Math.cos(g.altitude)*e,B=1):g.altitude>-.1?(E=e,B=1+10*g.altitude):(E=e,B=0);o.astroSun||o.photoSun?(h.attr("x2",100-Math.sin(g.azimuth)*E).attr("y2",100+Math.cos(g.azimuth)*E).attr("stroke-opacity",B),b.attr("cx",100-Math.sin(g.azimuth)*E/2).attr("cy",100+Math.cos(g.azimuth)*E/2).attr("fill-opacity",B),isNaN(S.azimuth)?(w.attr("x2",100).attr("y2",100),y.attr("x2",100).attr("y2",100)):(w.attr("x2",100-Math.sin(S.azimuth)*e).attr("y2",100+Math.cos(S.azimuth)*e),y.attr("x2",100-Math.sin(N.azimuth)*e).attr("y2",100+Math.cos(N.azimuth)*e))):(h.attr("x2",100).attr("y2",100),w.attr("x2",100).attr("y2",100),y.attr("x2",100).attr("y2",100),b.attr("fill-opacity",0));P.altitude>0?(j=Math.cos(P.altitude)*e,G=1):P.altitude>-.02?(j=e,G=1+50*P.altitude):(j=e,G=0);o.moon?(f.attr("x2",100-Math.sin(P.azimuth)*j).attr("y2",100+Math.cos(P.azimuth)*j).attr("stroke-opacity",G),C.attr("cx",100-Math.sin(P.azimuth)*j/2).attr("cy",100+Math.cos(P.azimuth)*j/2).attr("fill-opacity",G),isNaN(I.azimuth)?x.attr("x2",100).attr("y2",100):x.attr("x2",100-Math.sin(I.azimuth)*e).attr("y2",100+Math.cos(I.azimuth)*e),isNaN(A.azimuth)?k.attr("x2",100).attr("y2",100):k.attr("x2",100-Math.sin(A.azimuth)*e).attr("y2",100+Math.cos(A.azimuth)*e)):(f.attr("x2",100).attr("y2",100),x.attr("x2",100).attr("y2",100),k.attr("x2",100).attr("y2",100),C.attr("fill-opacity",0));const L=o.astroSun?o.photoSun?u:a:o.photoSun?l:r,F=180*SunCalc.getPosition(v.nadir,d,m).altitude/Math.PI,W=[];let J;for(const n in L.first){if(L.first[n].altitude>F)break;J=L.first[n]}W.push({time:0,name:void 0,raw_name:void 0,starts:J.starts,color_class:void 0,new_class:J.new_class});for(const n in v)L[n]&&!isNaN(v[n])&&W.push({time:v[n],name:L[n].name,raw_name:n,starts:L[n].starts,class:L[n].class,new_class:L[n].new_class});if(o.moon)for(const n in _)p[n]&&!isNaN(_[n])&&W.push({time:_[n],name:p[n].name,raw_name:"moon"+n,class:p[n].class});W.sort(((n,t)=>n.time>t.time?1:-1));const U=d3.select(".sun-times .timeline").html("");let Z="";for(const n in W){if(W[n].new_class&&(Z=W[n].new_class),W[n].time>0){const t=U.append("div").attr("class","timeline-entry timestamp "+(W[n].class?W[n].class+" ":"")+Z);t.append("span").attr("class","time-column").html(z(W[n].time)),t.append("span").attr("class","name-column").html(W[n].name),t.data([W[n].raw_name]).on("click",(function(n){H(n)}))}if(W[n].starts){const t=U.append("div").attr("class","timeline-entry timeframe "+Z);t.append("span").attr("class","time-column"),t.append("span").attr("class","name-column").html(W[n].starts)}}document.getElementById("current_time").innerHTML=z(new Date(t)),document.getElementById("azimuth").innerHTML=(180*g.azimuth/Math.PI).toFixed(1)+"&deg;",document.getElementById("altitude").innerHTML=(180*g.altitude/Math.PI).toFixed(1)+"&deg;";const Q=SunCalc.getMoonIllumination(t);let O;for(const n in c)n<Q.phase&&(O=c[n]);document.getElementById("azimuth-moon").innerHTML=(180*P.azimuth/Math.PI).toFixed(1)+"&deg;",document.getElementById("altitude-moon").innerHTML=(180*P.altitude/Math.PI).toFixed(1)+"&deg;",document.getElementById("phase-moon").innerHTML=O,document.getElementById("fraction-moon").innerHTML=(100*Q.fraction).toFixed(1)+"%",d3.select(".current-sun").classed("hide",!(o.astroSun||o.photoSun)),d3.select(".current-moon").classed("hide",!o.moon);const q=[],K=[],R=v.nadir.getTime(),V=100,X=864e5/V;for(let n=0;n<=V;n++)q[n]={x:1*n/V,y:-SunCalc.getPosition(R+X*n,d,m).altitude},K[n]={x:1*n/V,y:-SunCalc.getMoonPosition(R+X*n,d,m).altitude};const Y=d3.line().x((function(n){return 200*n.x})).y((function(n){return 100*(n.y+Math.PI/2)/Math.PI}));d3.select("#sun_path").attr("d",o.astroSun||o.photoSun?Y(q):""),d3.select("#moon_path").attr("d",o.moon?Y(K):""),d3.select(".path-circle#sun").attr("cx",s(200*(t-R)/864e5,200)).attr("cy",100*(-g.altitude+Math.PI/2)/Math.PI).style("opacity",o.astroSun||o.photoSun?1:0),d3.select(".path-circle#moon").attr("cx",s(200*(t-R)/864e5,200)).attr("cy",100*(-P.altitude+Math.PI/2)/Math.PI).style("opacity",o.moon?1:0)}(m)}function z(n){if(isNaN(n))return"--:--"+(i.get("zuluMode")?"Z":"");const t=new Date(new Date(n.getTime()).toLocaleString("en-US",{timeZone:M}));return T(t.getHours())+":"+T(t.getMinutes())+(i.get("zuluMode")?"Z":"")}function T(n){return n<10?"0"+n:n}function H(n){"moon"==n.substring(0,4)?i.set("timestamp",_[n.substring(4)].getTime()):i.set("timestamp",v[n].getTime())}t.emitter.on("pickerOpened",(n=>{d&&(S(),N(n))})),t.emitter.on("pickerMoved",(n=>{d&&N(n)})),t.emitter.on("pickerClosed",(()=>{d3.select(".sun-times").attr("id","hide"),d3.select(".open-picker").attr("id",""),d3.select(".picker").select("svg").remove()})),i.on("timestamp",(()=>{N()})),n.onclose=()=>{d=!1,m=void 0,d3.select(".picker").select("svg").remove()},n.onopen=()=>{d||(d=!0,d3.select(".picker").empty()||"none"==d3.select(".picker").style("display")||(S(),N()),d3.select(".plugin-content .footnote .plugin-version").html("0.3.6"),d3.select("#windy-plugin-sun-position .options .image-checkbox#photoSun").classed("off",!o.photoSun),d3.select("#windy-plugin-sun-position .options .image-checkbox#astroSun").classed("off",!o.astroSun),d3.select("#windy-plugin-sun-position .options .image-checkbox#moon").classed("off",!o.moon),d3.selectAll("#windy-plugin-sun-position .options .image-checkbox").on("click",(function(){const n=d3.select(this);o[n.attr("id")]=n.classed("off"),n.classed("off",!n.classed("off")),N()})))}}),'<div class="mobile-header">Sun Details</div><div class="plugin-content"><div class="options"><span class="image-checkbox" id="astroSun" title="Show sun details (astronomical)">&#x1f52d;</span>&nbsp; <span class="image-checkbox" id="photoSun" title="Show sun details (photography)">&#x1f4f7;</span>&nbsp; <span class="image-checkbox" id="moon" title="Show moon details">&#x263E;</span></div><div class="open-picker"><h2>Picker not open</h2>Please open the weather picker to define position for sun-details.</div><div class="sun-times" id="hide"><div class="timeline"></div><div class="current"><div class="current-time" id="current_time">12:25</div><svg class="sun-path"><path id="sun_path"/><path id="moon_path"/><path id="horizon" d="M 0 50 H 200"/><circle class="path-circle" id="moon" cx="50" cy="50" r="4"/><circle class="path-circle" id="sun" cx="50" cy="50" r="4"/></svg><div class="current-sun"><span class="current-pos-title" id="sun">Sun</span><br><span class="current-pos-label">Azimuth</span> <span class="current-pos" id="azimuth">0</span> <span class="current-pos-label">Altitude</span> <span class="current-pos" id="altitude">0</span></div><div class="current-moon"><span class="current-pos-title" id="moon">Moon</span><br><span class="current-pos-label">Azimuth</span> <span class="current-pos" id="azimuth-moon">0</span> <span class="current-pos-label">Altitude</span> <span class="current-pos" id="altitude-moon">0</span> <span class="current-pos-label">Phase</span> <span class="current-pos" id="phase-moon">full moon</span> <span class="current-pos-label">Illumination</span> <span class="current-pos" id="fraction-moon">100%</span></div></div></div><div class="footnote"><div>windy-plugin-sun-position@<span class="plugin-version"></span></div><div>by Jochen Jacobs (@jacobsjo)</div><br><a href="https://community.windy.com/topic/9017/sun-position-plugin">plugin page</a> <a href="https://www.npmjs.com/package/windy-plugin-sun-position">npm</a> <a href="https://github.com/jacobsjo/windy-plugin-sun-position">GitHub</a></div></div>','.onwindy-plugin-sun-position .left-border{left:270px}.onwindy-plugin-sun-position #search{display:none}#device-mobile .onwindy-plugin-sun-position .left-border{left:0}#device-mobile #bottom{z-index:2}.plugin-sun-position-mobile{position:absolute;top:250px;bottom:0px;width:100% !important}#device-mobile #windy-plugin-sun-position .plugin-content .footnote{margin-bottom:90px}#device-mobile #windy-plugin-sun-position .closing-x{display:block;right:0px;top:-1em}#device-mobile #windy-plugin-sun-position .open-picker,#device-mobile #windy-plugin-sun-position .sun-times{min-height:calc(100% - 120pt)}#windy-plugin-sun-position{width:270px;height:100%}#windy-plugin-sun-position .plugin-content{padding:15px 15px 15px 5px;font-size:14px;line-height:1.6;background-color:#404040;color:white}#windy-plugin-sun-position .plugin-content h2{color:white}#windy-plugin-sun-position .plugin-content .open-picker,#windy-plugin-sun-position .plugin-content .sun-times{min-height:calc(100% - 50pt)}#windy-plugin-sun-position .plugin-content .open-picker#hide,#windy-plugin-sun-position .plugin-content .sun-times#hide{display:none}#windy-plugin-sun-position .plugin-content .sun-times{width:250px;margin-top:10px;margin-left:auto;margin-right:auto}#windy-plugin-sun-position .plugin-content .sun-times .timeline-entry{position:relative}#windy-plugin-sun-position .plugin-content .sun-times .timeline-entry span{left:20px;display:inline-block;margin-bottom:0;padding-bottom:.5em}#windy-plugin-sun-position .plugin-content .sun-times .timeline-entry.timestamp{cursor:pointer}#windy-plugin-sun-position .plugin-content .sun-times .timeline-entry.timeframe{cursor:default}#windy-plugin-sun-position .plugin-content .sun-times .timeline-entry.timestamp::after{display:block;position:absolute;left:63px;top:0px;width:20px;height:20px;border-radius:10px;content:\' \'}#windy-plugin-sun-position .plugin-content .sun-times .timeline-entry.timestamp.minor::after{left:65px;top:2px;width:16px;height:16px;border-radius:8px}#windy-plugin-sun-position .plugin-content .sun-times .timeline-entry::before{content:"";position:absolute;left:71px;top:0px;border-left:4px solid;height:130%;width:3px}#windy-plugin-sun-position .plugin-content .sun-times .time-column{width:90px;text-align:right;padding-right:35px;color:white}#windy-plugin-sun-position .plugin-content .sun-times .nightColor{color:black}#windy-plugin-sun-position .plugin-content .sun-times .astroColor{color:#000030}#windy-plugin-sun-position .plugin-content .sun-times .nauticalColor{color:#121260}#windy-plugin-sun-position .plugin-content .sun-times .blueColor{color:blue}#windy-plugin-sun-position .plugin-content .sun-times .goldenColor{color:orange}#windy-plugin-sun-position .plugin-content .sun-times .dayColor{color:yellow}#windy-plugin-sun-position .plugin-content .sun-times .nightColor::after{background-color:black}#windy-plugin-sun-position .plugin-content .sun-times .astroColor::after{background-color:#000030}#windy-plugin-sun-position .plugin-content .sun-times .nauticalColor::after{background-color:#121260}#windy-plugin-sun-position .plugin-content .sun-times .blueColor::after{background-color:blue}#windy-plugin-sun-position .plugin-content .sun-times .goldenColor::after{background-color:orange}#windy-plugin-sun-position .plugin-content .sun-times .dayColor::after{background-color:yellow}#windy-plugin-sun-position .plugin-content .sun-times .nightColor::before{border-left-color:black}#windy-plugin-sun-position .plugin-content .sun-times .astroColor::before{border-left-color:#000030}#windy-plugin-sun-position .plugin-content .sun-times .nauticalColor::before{border-left-color:#121260}#windy-plugin-sun-position .plugin-content .sun-times .blueColor::before{border-left-color:blue}#windy-plugin-sun-position .plugin-content .sun-times .goldenColor::before{border-left-color:orange}#windy-plugin-sun-position .plugin-content .sun-times .dayColor::before{border-left-color:yellow}#windy-plugin-sun-position .plugin-content .sun-times .moon{color:gray}#windy-plugin-sun-position .plugin-content .sun-times .moon::after{background-color:gray}#windy-plugin-sun-position .plugin-content .sun-times .current-time{font-size:25pt;text-align:center}#windy-plugin-sun-position .plugin-content .sun-times .current-sun,#windy-plugin-sun-position .plugin-content .sun-times .current-moon{padding-top:10pt;padding-bottom:10pt;border-radius:10pt;margin-top:5pt;margin-bottom:5pt;background-color:#505050}#windy-plugin-sun-position .plugin-content .sun-times .current-sun.hide,#windy-plugin-sun-position .plugin-content .sun-times .current-moon.hide{display:none}#windy-plugin-sun-position .plugin-content .sun-times .current-pos-title{display:inline-block;margin-left:60pt;padding-bottom:10pt}#windy-plugin-sun-position .plugin-content .sun-times .current-pos-title::before{content:" ";display:inline-block;width:15pt;height:15pt;margin-bottom:-4pt;border-radius:7pt;margin-right:10pt}#windy-plugin-sun-position .plugin-content .sun-times .current-pos-title#sun::before{background-color:yellow}#windy-plugin-sun-position .plugin-content .sun-times .current-pos-title#moon::before{background-color:gray}#windy-plugin-sun-position .plugin-content .sun-times .current-pos{display:inline-block;width:60%;text-align:left;padding-left:10pt}#windy-plugin-sun-position .plugin-content .sun-times .current-pos-label{display:inline-block;width:35%;text-align:right}#windy-plugin-sun-position .plugin-content .sun-times .sun-path{width:200px;height:100px;margin-left:25px}#windy-plugin-sun-position .plugin-content .sun-times .sun-path path{fill:none;stroke:#606060;stroke-width:2px}#windy-plugin-sun-position .plugin-content .sun-times .sun-path path#sun_path{stroke-dasharray:10 2 1 2}#windy-plugin-sun-position .plugin-content .sun-times .sun-path path#moon_path{stroke-dasharray:0 1 2 2 3 2 3 1}#windy-plugin-sun-position .plugin-content .sun-times .path-circle#sun{fill:yellow}#windy-plugin-sun-position .plugin-content .sun-times .path-circle#moon{fill:gray}#windy-plugin-sun-position .plugin-content .options{text-align:center;margin-bottom:20pt}#windy-plugin-sun-position .plugin-content .options .image-checkbox{font-size:22pt;color:#404040;text-align:center;display:inline-block;width:30pt;height:30pt;border-radius:15pt;font-family:"Symbola";cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-khtml-user-select:none;-ms-user-select:none}#windy-plugin-sun-position .plugin-content .options .image-checkbox#photoSun,#windy-plugin-sun-position .plugin-content .options .image-checkbox#astroSun{background:#C0C000}#windy-plugin-sun-position .plugin-content .options .image-checkbox#moon{background:#C0C0C0}#windy-plugin-sun-position .plugin-content .options .image-checkbox.off{background:#505050 !important}#windy-plugin-sun-position .plugin-content .footnote{color:gray;font-size:8pt;width:150pt;margin-left:auto;margin-right:auto;display:flex;flex-wrap:wrap;gap:0pt 4pt}#windy-plugin-sun-position .plugin-content .footnote a{text-decoration:underline}#windy-plugin-sun-position .plugin-content .footnote .highlight{color:#9e9e37}.windy-plugin-sun-position.sun-position-dial{position:absolute;left:-99.5px;top:25.5px;width:199px;height:199px;pointer-events:none}.windy-plugin-sun-position.sun-position-dial .dial-line-sun{stroke:rgba(68,65,65,0.84);stroke-width:3}.windy-plugin-sun-position.sun-position-dial .dial-line-moon{stroke:rgba(68,65,65,0.84);stroke-width:3}.windy-plugin-sun-position.sun-position-dial .dial-circle-sun{fill:yellow}.windy-plugin-sun-position.sun-position-dial .dial-circle-moon{fill:gray}.windy-plugin-sun-position.sun-position-dial .dial-line-sunrise,.windy-plugin-sun-position.sun-position-dial .dial-line-sunset,.windy-plugin-sun-position.sun-position-dial .dial-line-moonrise,.windy-plugin-sun-position.sun-position-dial .dial-line-moonset{stroke:rgba(68,65,65,0.84);stroke-width:2;stroke-dasharray:10 2 1 2;pointer-events:auto}.windy-plugin-sun-position.sun-position-dial .dial-line-moonrise,.windy-plugin-sun-position.sun-position-dial .dial-line-moonset{stroke-dasharray:0 1 2 2 3 2 3 1}.windy-plugin-sun-position.sun-position-dial #hover.dial-line-sunrise,.windy-plugin-sun-position.sun-position-dial #hover.dial-line-sunset,.windy-plugin-sun-position.sun-position-dial #hover.dial-line-moonrise,.windy-plugin-sun-position.sun-position-dial #hover.dial-line-moonset{stroke-width:4}#device-mobile .windy-plugin-sun-position.sun-position-dial{top:.5px;left:-69.5px;width:139px;height:139px}#device-mobile .windy-plugin-sun-position.sun-position-dial .dial-line-sun,#device-mobile .windy-plugin-sun-position.sun-position-dial .dial-line-moon{stroke-width:5}#device-mobile .windy-plugin-sun-position.sun-position-dial .dial-line-sunrise,#device-mobile .windy-plugin-sun-position.sun-position-dial .dial-line-sunset,#device-mobile .windy-plugin-sun-position.sun-position-dial .dial-line-moonrise,#device-mobile .windy-plugin-sun-position.sun-position-dial .dial-line-moonset{stroke-width:4}');
{
"name": "windy-plugin-sun-position",
"version": "0.3.5",
"type": "module",
"version": "0.3.6",
"description": "Windy plugin that gives shows sun position on the map and gives details about sunset and sunrise times.",

@@ -19,16 +20,27 @@ "main": "dist/plugin.js",

"dependencies": {
"@babel/core": "^7.1.2",
"@babel/preset-env": "^7.1.0",
"chokidar": "^2.0.4",
"colorette": "^1.0.6",
"commander": "^2.19.0",
"consola": "^1.4.4",
"decache": "^4.4.0",
"express": "^4.16.4",
"fs-extra": "^7.0.0",
"less": "^3.8.1",
"prompts": "^1.1.1",
"riot-compiler": "^3.5.1",
"@babel/preset-env": "^7.21.5",
"@rollup/plugin-babel": "^6.0.3",
"@rollup/plugin-commonjs": "^25.0.0",
"@rollup/plugin-node-resolve": "^15.0.2",
"@rollup/plugin-terser": "^0.4.3",
"chokidar": "^3.5.3",
"colorette": "^2.0.20",
"commander": "^10.0.1",
"consola": "^3.1.0",
"decache": "^4.6.1",
"estree-walker": "^3.0.3",
"express": "^4.18.2",
"html-minifier": "^4.0.0",
"less": "^4.1.3",
"magic-string": "^0.30.0",
"prompts": "^2.4.2",
"rollup": "^3.22.0",
"rollup-plugin-cleanup": "^3.2.1",
"ucfirst": "^1.0.0"
},
"devDependencies": {
"eslint": "^8.40.0",
"eslint-plugin-html": "^7.1.0",
"prettier": "^2.8.8"
}
}

@@ -61,1 +61,3 @@ <p align="center"><img src="https://www.windy.com/img/logo201802/logo-full-windycom-gray-v3.svg"></p>

- fixed issue finding location (broken by change on windy)
#### V0.3.6
- fixed plugin loading issue (broken by change on windy)

@@ -1,18 +0,18 @@

module.exports = {
displayName: 'Sun Position',
export default {
displayName: 'Sun Position',
hook: 'contextmenu',
hook: 'contextmenu',
dependencies: [
'https://unpkg.com/d3@5.7.0/dist/d3.min.js',
'https://unpkg.com/suncalc@1.8.0/suncalc.js',
'https://unpkg.com/tz-lookup@6.1.25/tz.js'
],
dependencies: [
'https://unpkg.com/d3@5.7.0/dist/d3.min.js',
'https://unpkg.com/suncalc@1.8.0/suncalc.js',
'https://unpkg.com/tz-lookup@6.1.25/tz.js'
],
// className: 'plugin-lhpane',
// className: 'plugin-lhpane',
className: 'plugin-lhpane plugin-mobile-fullscreen',
classNameMobile: 'plugin-sun-position-mobile',
className: 'plugin-lhpane plugin-mobile-fullscreen',
classNameMobile: 'plugin-sun-position-mobile',
exclusive: 'lhpane',
exclusive: 'lhpane',
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc