Open aoqizhonghua opened 3 years ago
You mean like on the repository you're commenting on?
https://github.com/cambecc/earth/tree/master/public/libs/earth/1.0.0
yes
That's the javascript source code. The other libraries in libs are utilized in order to do various functional things within earth.
I want to know how to realize the function of HTSGW ( Significant Wave Height ), but I don't know much about it
Look at the actual site, browser code inspector. Grep for HTSGW. You'll find createHTSGWPalette in HTSGW.js based on generic buildScaleFromSegments.
import {buildScaleFromSegments} from "./palette.js";
export function createHTSGWPalette(resolution = 1000) {
const bounds = [0, 15]; // units: m
const segments = [
[ 0, [ 8, 29, 88]],
[ 1, [ 37, 52, 148]],
[ 2, [ 34, 94, 168]],
[ 3, [ 29, 145, 192]],
[ 4, [ 65, 182, 196]],
[ 5, [127, 205, 187]],
[ 6, [199, 233, 180]],
[ 7, [237, 248, 177]],
[ 8, [254, 204, 92]],
[10, [253, 141, 60]],
[12, [240, 59, 32]],
[14, [189, 0, 38]],
];
return buildScaleFromSegments(bounds, segments, resolution);
}
Is there a paid version? I want a source code